|
|
@@ -30,7 +30,8 @@ Component({
|
|
|
pageNumber: 1,
|
|
|
pageTotal: 1,
|
|
|
pageSize: 20
|
|
|
- }
|
|
|
+ },
|
|
|
+ list: []
|
|
|
},
|
|
|
methods: {
|
|
|
async getList(init = false) {
|
|
|
@@ -49,8 +50,6 @@ Component({
|
|
|
content.type = type;
|
|
|
content.username = username;
|
|
|
content.where.isleave = isleave;
|
|
|
- let dividend = wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000,
|
|
|
- getMapText = getApp().globalData.Language.getMapText;
|
|
|
if (init) {
|
|
|
pages.pageNumber = 1;
|
|
|
pages.pageTotal = 1;
|
|
|
@@ -92,9 +91,16 @@ Component({
|
|
|
this.initChart(res.data)
|
|
|
})
|
|
|
},
|
|
|
+ toDetail(e) {
|
|
|
+ let content = this.data.content;
|
|
|
+ content.sys_enterpriseid = e.currentTarget.dataset.item.sys_enterpriseid;
|
|
|
+ content.enterprisename = e.currentTarget.dataset.item.enterprisename;
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/salesPanel/FinancialCollectionAnalysis/detail?content=' + JSON.stringify(content)
|
|
|
+ })
|
|
|
+ },
|
|
|
initChart(data) {
|
|
|
let dividend = wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000,
|
|
|
- getMapText = getApp().globalData.Language.getMapText,
|
|
|
list = [{
|
|
|
name: "0-3月未回款金额(万元)",
|
|
|
color: "#5B8FF9"
|
|
|
@@ -110,14 +116,11 @@ Component({
|
|
|
}];
|
|
|
|
|
|
let series = list.map(item => ({
|
|
|
- name: getMapText(item.name),
|
|
|
+ name: getApp().globalData.Language.getMapText(item.name),
|
|
|
type: 'bar',
|
|
|
stack: 'total',
|
|
|
label: {
|
|
|
- show: true,
|
|
|
- formatter: function (params) {
|
|
|
- return params.value === 0 ? '' : params.value;
|
|
|
- }
|
|
|
+ show: true
|
|
|
},
|
|
|
emphasis: {
|
|
|
focus: 'series'
|
|
|
@@ -137,8 +140,9 @@ Component({
|
|
|
confine: true, // Ensure tooltip stays within the chart area
|
|
|
formatter: function (params) {
|
|
|
let tooltipText = '';
|
|
|
+ changeUnwriteoffamounttype(['订单', '出货', '开票'][params[0].dataIndex])
|
|
|
params.forEach((item, index) => {
|
|
|
- tooltipText += `${index==0?item.axisValue+'\n':''}${item.marker}${item.seriesName}: ${item.value}${item.seriesName == getMapText('同比增长率') ? '%' : ''}\n`;
|
|
|
+ tooltipText += `${index==0?item.axisValue+'\n':''}${item.marker}${item.seriesName}: ${item.value}\n`;
|
|
|
});
|
|
|
return tooltipText;
|
|
|
},
|
|
|
@@ -147,7 +151,7 @@ Component({
|
|
|
}
|
|
|
},
|
|
|
legend: {
|
|
|
- data: list.map(item => getMapText(item.name))
|
|
|
+ data: list.map(item => getApp().globalData.Language.getMapText(item.name))
|
|
|
},
|
|
|
grid: {
|
|
|
left: '3%',
|
|
|
@@ -160,10 +164,27 @@ Component({
|
|
|
},
|
|
|
yAxis: {
|
|
|
type: 'category',
|
|
|
- data: ['订单', '出货', '开票'].map(v => getMapText(v))
|
|
|
+ data: ['订单', '出货', '开票'].map(v => getApp().globalData.Language.getMapText(v))
|
|
|
},
|
|
|
series
|
|
|
};
|
|
|
+ let countDown = null,
|
|
|
+ that = this;
|
|
|
+
|
|
|
+ function changeUnwriteoffamounttype(type) {
|
|
|
+ if (countDown) return;
|
|
|
+ countDown = setTimeout(() => {
|
|
|
+ clearTimeout(countDown)
|
|
|
+ countDown = null;
|
|
|
+ if (type != that.data.content.unwriteoffamounttype) {
|
|
|
+ that.setData({
|
|
|
+ "content.unwriteoffamounttype": type,
|
|
|
+ "pages.pageNumber": 1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ that.getList()
|
|
|
+ }, 200)
|
|
|
+ };
|
|
|
this.chartComponent = this.selectComponent('#mychart');
|
|
|
this.chartComponent.init((canvas, width, height, dpr) => {
|
|
|
const chart = echarts.init(canvas, null, {
|