xiaohaizhao 11 bulan lalu
induk
melakukan
d39fb1d547

+ 31 - 4
salesPanel/AnalysisOfTheProportionOfProductCategoriesInOrders/index.js

@@ -120,7 +120,8 @@ Component({
         }, {
             remarks: '二级类别',
             value: "二级类别",
-        }]
+        }],
+        total: 0
     },
     methods: {
         async getList(init = false) {
@@ -143,7 +144,9 @@ Component({
                 content.pageNumber = 1;
                 content.pageTotal = 1;
             }
+            console.log(content)
             if (content.pageNumber > content.pageTotal) return;
+            console.log(2)
             _Http.basic({
                 "id": 20240524160004,
                 content
@@ -163,8 +166,9 @@ Component({
                 this.setData({
                     list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
                     "content.pageNumber": res.pageNumber + 1,
+                    "content.pageTotal": res.pageTotal,
                     "content.pageSize": res.pageSize,
-
+                    total: res.total,
                 })
                 try {
                     this.selectComponent("#TimeRange").onCancel()
@@ -177,13 +181,36 @@ Component({
 
 
                 }
-                this.initChart(res.data[0].ratio, content.dataType == '金额' ? CNY(res.data[0].ratio[0].total / dividend) : res.data[0].ratio[0].total, getMapText);
+                if (init) this.initChart(res.data[0].ratio, content.dataType == '金额' ? CNY(res.data[0].ratio[0].total / dividend) : res.data[0].ratio[0].total, getMapText);
             })
         },
         initChart(data, total, getMapText) {
+            let countDown = null,
+                that = this;
+
+            function changeUnwriteoffamounttype(params) {
+                if (countDown) return;
+                countDown = setTimeout(() => {
+                    clearTimeout(countDown)
+                    countDown = null;
+                    if (params.itemclassid != that.data.content.where.itemclassid) {
+                        that.setData({
+                            "content.where.itemclassid": params.itemclassid,
+                            "content.pageNumber": 1,
+                            itemclassfullname: params.itemclassfullname
+                        })
+                    }
+                    that.getList()
+                }, 200)
+            };
+
             let option = {
                 tooltip: {
-                    trigger: 'item'
+                    trigger: 'item',
+                    formatter: function (params) {
+                        changeUnwriteoffamounttype(data[params.dataIndex]);
+                        return `${params.marker}${params.name}: ${params.value}`;
+                    },
                 },
                 legend: {
                     bottom: '5%', // Moved legend to the bottom

+ 17 - 6
salesPanel/AnalysisOfTheProportionOfProductCategoriesInOrders/index.wxml

@@ -8,19 +8,30 @@
 		</view>
 	</view>
 	<timeRange id='TimeRange' dateTypes='{{dateTypes}}' dateType='{{content.dateType}}' bind:onChange='changeDate' />
-	<filtrate id='Filtrate' wx:if='{{types.length}}' list='{{types}}' type="{{content.where.type}}" title='订单类型' bind:onChange='changeType2' />
-	<filtrate id='Filtrate' iconName='icon-lingyu' wx:if='{{tradefields.length}}' list='{{tradefields}}' type="{{content.where.tradefield}}" title='领域' bind:onChange='changeTradefield' />
-	<filtrate id='Filtrate' iconName='icon-chengjiaozhuangtai' wx:if='{{brands.length}}' list='{{brands}}' type="{{content.where.sa_brandid}}" title='领域' bind:onChange='changeSa_brandid' />
-	<filtrate id='Filtrate' iconName='icon-yingxiaoleibie' list='{{itemclassList}}' type="{{content.itemclass}}" title='营销分类' bind:onChange='changeItemclass' />
+	<filtrate id='Filtrate' wx:if='{{types.length}}' list='{{types}}' type="{{content.where.type}}" title='订单类型'
+		bind:onChange='changeType2' />
+	<filtrate id='Filtrate' iconName='icon-lingyu' wx:if='{{tradefields.length}}' list='{{tradefields}}'
+		type="{{content.where.tradefield}}" title='领域' bind:onChange='changeTradefield' />
+	<filtrate id='Filtrate' iconName='icon-chengjiaozhuangtai' wx:if='{{brands.length}}' list='{{brands}}'
+		type="{{content.where.sa_brandid}}" title='品牌' bind:onChange='changeSa_brandid' />
+	<filtrate id='Filtrate' iconName='icon-yingxiaoleibie' list='{{itemclassList}}' type="{{content.itemclass}}"
+		title='营销分类' bind:onChange='changeItemclass' />
 	<view class="global-card" wx:if='{{!list[0].isEmpty}}'>
 		<view class="chart">
 			<ec-canvas id="mychart" canvas-id="chart" ec="{{ ec }}"></ec-canvas>
 		</view>
 	</view>
+	<view style="margin-left: 30rpx;margin-bottom:20rpx;">
+		{{language[itemclassfullname||'全部']||itemclassfullname||'全部'}}({{total}})
+	</view>
 	<My_empty wx:if='{{list[0].isEmpty}}' />
 	<block wx:else>
-		<navigator url="#" class="global-card item" wx:for="{{list}}" version='develop' wx:key="sonum" target='miniProgram' app-id='wxc1b6ae925ac1d06a' path="{{'/packageA/orderForm/detail'+'?auth='+auth+'&userMsg='+userMsg+'&site='+site+'&templetList='+templetList+'$languagecode='+languagecode+'&id='+item.sa_orderid}}" url="/packageA/orderForm/detail" open-type="navigate">
-			<view class="title"><text class="tag" style="background-color: #67C23A;">{{language[item.tradefield]||item.tradefield}}</text>{{item.sonum}}
+		<navigator url="#" class="global-card item" wx:for="{{list}}" version='develop' wx:key="sonum"
+			target='miniProgram' app-id='wxc1b6ae925ac1d06a'
+			path="{{'/packageA/orderForm/detail'+'?auth='+auth+'&userMsg='+userMsg+'&site='+site+'&templetList='+templetList+'$languagecode='+languagecode+'&id='+item.sa_orderid}}"
+			url="/packageA/orderForm/detail" open-type="navigate">
+			<view class="title"><text class="tag"
+					style="background-color: #67C23A;">{{language[item.tradefield]||item.tradefield}}</text>{{item.sonum}}
 			</view>
 			<view class="row">erp{{language['单号']||'单号'}}:{{item.erpbillno ||' --'}}</view>
 			<view class="row">

+ 8 - 6
salesPanel/FinancialCollectionAnalysis/index.js

@@ -33,7 +33,8 @@ Component({
             pageTotal: 1,
             pageSize: 20
         },
-        list: []
+        list: [],
+        total: 0
     },
     methods: {
         async getList(init = false) {
@@ -78,7 +79,8 @@ Component({
                 pages.pageTotal = res.pageTotal;
                 this.setData({
                     list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
-                    pages
+                    pages,
+                    total: res.total
                 })
             })
             if (init) _Http.basic({
@@ -130,19 +132,18 @@ Component({
                 itemStyle: {
                     color: item.color
                 },
-                data: ['订单', '出货', '开票'].map(type => {
+                data: ['开票', '出货', '订单'].map(type => {
                     let filtered = data.filter(d => d.type === type && d.key.includes(item.name.split('(')[0]));
                     return filtered.length ? (filtered[0].value / dividend).toFixed(2) : 0;
                 })
             }));
-
             let option = {
                 tooltip: {
                     trigger: 'axis',
                     confine: true, // Ensure tooltip stays within the chart area
                     formatter: function (params) {
                         let tooltipText = '';
-                        changeUnwriteoffamounttype(['订单', '出货', '开票'][params[0].dataIndex])
+                        changeUnwriteoffamounttype(['开票', '出货', '订单'][params[0].dataIndex])
                         params.forEach((item, index) => {
                             tooltipText += `${index==0?item.axisValue+'\n':''}${item.marker}${item.seriesName}: ${item.value}\n`;
                         });
@@ -166,7 +167,8 @@ Component({
                 },
                 yAxis: {
                     type: 'category',
-                    data: ['订单', '出货', '开票'].map(v => getApp().globalData.Language.getMapText(v))
+                    data: ['开票', '出货', '订单'].map(v => getApp().globalData.Language.getMapText(v)),
+                    inverse: false // Disable automatic sorting
                 },
                 series
             };

+ 5 - 1
salesPanel/FinancialCollectionAnalysis/index.wxml

@@ -7,9 +7,13 @@
 	<view class="chart2">
 		<ec-canvas id="mychart" canvas-id="chart" ec="{{ ec }}"></ec-canvas>
 	</view>
+	<view style="margin-left:30rpx;margin-bottom:20rpx;">
+		{{language[content.unwriteoffamounttype]||content.unwriteoffamounttype}}({{total}})
+	</view>
 	<My_empty wx:if='{{!list.length}}' />
 	<block wx:else>
-		<view hover-class="navigator-hover" url="#" class="global-card item" wx:for="{{list}}" wx:key="sys_enterpriseid" data-item="{{item}}" bind:tap="toDetail">
+		<view hover-class="navigator-hover" url="#" class="global-card item" wx:for="{{list}}" wx:key="sys_enterpriseid"
+			data-item="{{item}}" bind:tap="toDetail">
 			<view class="title">
 				{{item.enterprisename}}
 			</view>

+ 26 - 2
salesPanel/analysisOfOrderTypeDistribution/index.js

@@ -40,6 +40,7 @@ Component({
                 type: "",
             }
         },
+        total: 0
     },
     methods: {
         async getList(init = false) {
@@ -81,16 +82,39 @@ Component({
                 this.setData({
                     list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
                     "content.pageNumber": res.pageNumber + 1,
+                    "content.pageTotal": res.pageTotal,
                     "content.pageSize": res.pageSize,
+                    total: res.total,
                 })
                 this.selectComponent("#TimeRange").onCancel()
-                this.initChart(res.data[0].ratio, content.dataType == '金额' ? CNY(res.data[0].ratio[0].total / dividend) : res.data[0].ratio[0].total, getMapText);
+                if (init) this.initChart(res.data[0].ratio, content.dataType == '金额' ? CNY(res.data[0].ratio[0].total / dividend) : res.data[0].ratio[0].total, getMapText);
             })
         },
         initChart(data, total, getMapText) {
+            let countDown = null,
+                that = this;
+
+            function changeUnwriteoffamounttype(params) {
+                if (countDown) return;
+                countDown = setTimeout(() => {
+                    clearTimeout(countDown)
+                    countDown = null;
+                    if (params.type != that.data.content.where.type) {
+                        that.setData({
+                            "content.where.type": params.type,
+                            "content.pageNumber": 1
+                        })
+                    }
+                    that.getList()
+                }, 200)
+            };
             let option = {
                 tooltip: {
-                    trigger: 'item'
+                    trigger: 'item',
+                    formatter: function (params) {
+                        changeUnwriteoffamounttype(data[params.dataIndex]);
+                        return `${params.marker}${params.name}: ${params.value}`;
+                    },
                 },
                 legend: {
                     bottom: '5%', // Moved legend to the bottom

+ 13 - 4
salesPanel/analysisOfOrderTypeDistribution/index.wxml

@@ -1,6 +1,8 @@
 <view class="global-card tabs">
-	<view class="tab {{content.dataType == '金额' ? 'active':''}}" data-name='金额' bind:tap="changeType">{{language['金额']||'金额'}}</view>
-	<view class="tab {{content.dataType == '数量' ? 'active':''}}" data-name='数量' bind:tap="changeType">{{language['数量']||'数量'}}</view>
+	<view class="tab {{content.dataType == '金额' ? 'active':''}}" data-name='金额' bind:tap="changeType">
+		{{language['金额']||'金额'}}</view>
+	<view class="tab {{content.dataType == '数量' ? 'active':''}}" data-name='数量' bind:tap="changeType">
+		{{language['数量']||'数量'}}</view>
 </view>
 <timeRange id='TimeRange' dateTypes='{{dateTypes}}' dateType='{{content.dateType}}' bind:onChange='changeDate' />
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
@@ -9,11 +11,18 @@
 			<ec-canvas id="mychart" canvas-id="chart" ec="{{ ec }}"></ec-canvas>
 		</view>
 	</view>
+	<view style="margin-left: 30rpx;margin-bottom:20rpx;">
+		{{language[content.where.type||'全部']||content.where.type||'全部'}}({{total}})
+	</view>
 	<My_empty wx:if='{{list[0].isEmpty}}' />
 	<block wx:else>
-		<navigator url="#" class="global-card item" wx:for="{{list}}" version='develop' wx:key="sonum" target='miniProgram' app-id='wxc1b6ae925ac1d06a' path="{{'/packageA/orderForm/detail'+'?auth='+auth+'&userMsg='+userMsg+'&site='+site+'&templetList='+templetList+'$languagecode='+languagecode+'&id='+item.sa_orderid}}" url="/packageA/orderForm/detail" open-type="navigate">
+		<navigator url="#" class="global-card item" wx:for="{{list}}" version='develop' wx:key="sonum"
+			target='miniProgram' app-id='wxc1b6ae925ac1d06a'
+			path="{{'/packageA/orderForm/detail'+'?auth='+auth+'&userMsg='+userMsg+'&site='+site+'&templetList='+templetList+'$languagecode='+languagecode+'&id='+item.sa_orderid}}"
+			url="/packageA/orderForm/detail" open-type="navigate">
 			<view class="title">
-				<text class="tag" style="background-color: #67C23A;">{{language[item.tradefield]||item.tradefield}}</text>
+				<text class="tag"
+					style="background-color: #67C23A;">{{language[item.tradefield]||item.tradefield}}</text>
 				{{item.sonum}}
 			</view>
 			<view class="row">erp{{language['单号']||'单号'}}:{{item.erpbillno ||' --'}}</view>

+ 27 - 0
salesPanel/shipmentAnalysis/index.js

@@ -27,11 +27,13 @@ Component({
     },
     data: {
         "content": {
+            dateType: "",
             pageNumber: 1,
             pageTotal: 1,
             enddate: new Date().toISOString().split('T')[0],
             where: {}
         },
+        total: 0
     },
     methods: {
         async getList(init = false) {
@@ -89,6 +91,7 @@ Component({
                     list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
                     "content.pageNumber": res.pageNumber + 1,
                     "content.pageSize": res.pageSize,
+                    total: res.total
                 })
                 const modifiedData = res.data[0].trend.map(v => {
                     if (v.key === '一季以上') {
@@ -109,7 +112,31 @@ Component({
             })
         },
         initChart(data, getMapText) {
+            let countDown = null,
+                that = this;
+
+            function changeUnwriteoffamounttype(type) {
+                if (countDown) return;
+                countDown = setTimeout(() => {
+                    clearTimeout(countDown)
+                    countDown = null;
+                    console.log(type, that.data.content.dateType)
+                    if (type != that.data.content.dateType) {
+                        that.setData({
+                            "content.dateType": type,
+                            "pages.pageNumber": 1
+                        })
+                    }
+                    that.getList()
+                }, 200)
+            };
+
             let option = {
+                tooltip: {
+                    formatter: function (params) {
+                        changeUnwriteoffamounttype(['一周', '一月', '一季', '一季以上'][params.data.sequence - 1]);
+                    },
+                },
                 xAxis: {
                     max: 'dataMax'
                 },

+ 5 - 2
salesPanel/shipmentAnalysis/index.wxml

@@ -7,12 +7,15 @@
 	<view class="chart2">
 		<ec-canvas id="mychart" canvas-id="chart" ec="{{ ec }}"></ec-canvas>
 	</view>
-
+	<view class="dateType" style="margin-left: 30rpx;margin-bottom: 20rpx;">
+		{{language[content.dateType||'全部']||content.dateType||'全部'}}({{total}})
+	</view>
 	<My_empty wx:if='{{list[0].isEmpty}}' />
 	<block wx:else>
 		<view class="global-card" wx:for="{{list}}" wx:key="sa_orderitemsid">
 			<view class="title">
-				<text class="tag" style="background-color: #67C23A;">{{language[item.tradefield]||item.tradefield}}</text>
+				<text class="tag"
+					style="background-color: #67C23A;">{{language[item.tradefield]||item.tradefield}}</text>
 				{{item.sonum}}
 			</view>
 			<view class="row">erp{{language['单号']||'单号'}}:{{item.erpbillno ||' --'}}</view>