|
@@ -341,7 +341,7 @@
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
- ...mapActions('chart', ['getProvince', 'getProvinceAll', 'getEquipmentStatistics', 'getMainStatistics',
|
|
|
|
|
|
+ ...mapActions('chart', ['getEquipmentStatistics', 'getMainStatistics',
|
|
'getMachineNum'
|
|
'getMachineNum'
|
|
]),
|
|
]),
|
|
async init() {
|
|
async init() {
|
|
@@ -432,46 +432,46 @@
|
|
|
|
|
|
return this.getStatisticsData(chartType);
|
|
return this.getStatisticsData(chartType);
|
|
},
|
|
},
|
|
- initDateRang2(day, chartType) {
|
|
|
|
- const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
|
|
- if (chartType === 'day') {
|
|
|
|
- this.startDate5 = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
|
|
- }
|
|
|
|
- if (chartType === 'week') {
|
|
|
|
- this.startDate6 = dateUtils.formateDate(dateUtils.getFirstDayOfWeek(day), 'yyyy/MM/dd');
|
|
|
|
- this.endDate6 = dateUtils.formateDate(dateUtils.getLastDayOfWeek(day), 'yyyy/MM/dd');
|
|
|
|
- }
|
|
|
|
- if (chartType === 'month') {
|
|
|
|
- this.startDate7 = dateUtils.formateDate(dateUtils.getCurrentMonFirstDate(day), 'yyyy/MM/dd');
|
|
|
|
- this.endDate7 = dateUtils.formateDate(dateUtils.getCurrentMonLastDate(day), 'yyyy/MM/dd');
|
|
|
|
- }
|
|
|
|
- if (chartType === 'year') {
|
|
|
|
- this.startDate8 = dateUtils.formateDate(dateUtils.getCurrentYearFirstDate(day), 'yyyy/MM/dd');
|
|
|
|
- this.endDate8 = dateUtils.formateDate(dateUtils.getCurrentYearLastDate(day), 'yyyy/MM/dd');
|
|
|
|
- }
|
|
|
|
|
|
+ // initDateRang2(day, chartType) {
|
|
|
|
+ // const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
|
|
+ // if (chartType === 'day') {
|
|
|
|
+ // this.startDate5 = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType === 'week') {
|
|
|
|
+ // this.startDate6 = dateUtils.formateDate(dateUtils.getFirstDayOfWeek(day), 'yyyy/MM/dd');
|
|
|
|
+ // this.endDate6 = dateUtils.formateDate(dateUtils.getLastDayOfWeek(day), 'yyyy/MM/dd');
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType === 'month') {
|
|
|
|
+ // this.startDate7 = dateUtils.formateDate(dateUtils.getCurrentMonFirstDate(day), 'yyyy/MM/dd');
|
|
|
|
+ // this.endDate7 = dateUtils.formateDate(dateUtils.getCurrentMonLastDate(day), 'yyyy/MM/dd');
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType === 'year') {
|
|
|
|
+ // this.startDate8 = dateUtils.formateDate(dateUtils.getCurrentYearFirstDate(day), 'yyyy/MM/dd');
|
|
|
|
+ // this.endDate8 = dateUtils.formateDate(dateUtils.getCurrentYearLastDate(day), 'yyyy/MM/dd');
|
|
|
|
+ // }
|
|
|
|
|
|
- return this.getProvinceData(chartType);
|
|
|
|
- },
|
|
|
|
- initDateRang3(day, chartType) {
|
|
|
|
- const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
|
|
- if (chartType === 'day') {
|
|
|
|
- this.startDate9 = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
|
|
- }
|
|
|
|
- if (chartType === 'week') {
|
|
|
|
- this.startDate10 = dateUtils.formateDate(dateUtils.getFirstDayOfWeek(day), 'yyyy/MM/dd');
|
|
|
|
- this.endDate10 = dateUtils.formateDate(dateUtils.getLastDayOfWeek(day), 'yyyy/MM/dd');
|
|
|
|
- }
|
|
|
|
- if (chartType === 'month') {
|
|
|
|
- this.startDate11 = dateUtils.formateDate(dateUtils.getCurrentMonFirstDate(day), 'yyyy/MM/dd');
|
|
|
|
- this.endDate11 = dateUtils.formateDate(dateUtils.getCurrentMonLastDate(day), 'yyyy/MM/dd');
|
|
|
|
- }
|
|
|
|
- if (chartType === 'year') {
|
|
|
|
- this.startDate12 = dateUtils.formateDate(dateUtils.getCurrentYearFirstDate(day), 'yyyy/MM/dd');
|
|
|
|
- this.endDate12 = dateUtils.formateDate(dateUtils.getCurrentYearLastDate(day), 'yyyy/MM/dd');
|
|
|
|
- }
|
|
|
|
|
|
+ // return this.getProvinceData(chartType);
|
|
|
|
+ // },
|
|
|
|
+ // initDateRang3(day, chartType) {
|
|
|
|
+ // const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
|
|
+ // if (chartType === 'day') {
|
|
|
|
+ // this.startDate9 = dateUtils.formateDate(day, 'yyyy/MM/dd');
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType === 'week') {
|
|
|
|
+ // this.startDate10 = dateUtils.formateDate(dateUtils.getFirstDayOfWeek(day), 'yyyy/MM/dd');
|
|
|
|
+ // this.endDate10 = dateUtils.formateDate(dateUtils.getLastDayOfWeek(day), 'yyyy/MM/dd');
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType === 'month') {
|
|
|
|
+ // this.startDate11 = dateUtils.formateDate(dateUtils.getCurrentMonFirstDate(day), 'yyyy/MM/dd');
|
|
|
|
+ // this.endDate11 = dateUtils.formateDate(dateUtils.getCurrentMonLastDate(day), 'yyyy/MM/dd');
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType === 'year') {
|
|
|
|
+ // this.startDate12 = dateUtils.formateDate(dateUtils.getCurrentYearFirstDate(day), 'yyyy/MM/dd');
|
|
|
|
+ // this.endDate12 = dateUtils.formateDate(dateUtils.getCurrentYearLastDate(day), 'yyyy/MM/dd');
|
|
|
|
+ // }
|
|
|
|
|
|
- return this.getProvinceAllData(chartType);
|
|
|
|
- },
|
|
|
|
|
|
+ // return this.getProvinceAllData(chartType);
|
|
|
|
+ // },
|
|
/**上一个 */
|
|
/**上一个 */
|
|
pre(chartType) {
|
|
pre(chartType) {
|
|
let day;
|
|
let day;
|
|
@@ -691,177 +691,177 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- getProvinceData(chartType) {
|
|
|
|
- const param = {
|
|
|
|
- 'chartType': chartType
|
|
|
|
- };
|
|
|
|
- if (chartType == 'day') {
|
|
|
|
- param['startDate'] = this.startDate5;
|
|
|
|
- param['endDate'] = this.startDate5;
|
|
|
|
- }
|
|
|
|
- if (chartType == 'week') {
|
|
|
|
- param['startDate'] = this.startDate6;
|
|
|
|
- param['endDate'] = this.endDate6;
|
|
|
|
- }
|
|
|
|
- if (chartType == 'month') {
|
|
|
|
- param['startDate'] = this.startDate7;
|
|
|
|
- param['endDate'] = this.endDate7;
|
|
|
|
- }
|
|
|
|
- if (chartType == 'year') {
|
|
|
|
- param['startDate'] = this.startDate8;
|
|
|
|
- param['endDate'] = this.endDate8;
|
|
|
|
- }
|
|
|
|
- if (this.adminId) { // 子组件,则拿传过来的参
|
|
|
|
- param['adminId'] = this.adminId;
|
|
|
|
- } else if ('admin' !== this.loginUser['username']) { //否则为主页,拿登录用户
|
|
|
|
- param['adminId'] = this.loginUser['id'];
|
|
|
|
- }
|
|
|
|
- if (this.equipmentId) {
|
|
|
|
- param['equipmentId'] = this.equipmentId;
|
|
|
|
- }
|
|
|
|
|
|
+ // getProvinceData(chartType) {
|
|
|
|
+ // const param = {
|
|
|
|
+ // 'chartType': chartType
|
|
|
|
+ // };
|
|
|
|
+ // if (chartType == 'day') {
|
|
|
|
+ // param['startDate'] = this.startDate5;
|
|
|
|
+ // param['endDate'] = this.startDate5;
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType == 'week') {
|
|
|
|
+ // param['startDate'] = this.startDate6;
|
|
|
|
+ // param['endDate'] = this.endDate6;
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType == 'month') {
|
|
|
|
+ // param['startDate'] = this.startDate7;
|
|
|
|
+ // param['endDate'] = this.endDate7;
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType == 'year') {
|
|
|
|
+ // param['startDate'] = this.startDate8;
|
|
|
|
+ // param['endDate'] = this.endDate8;
|
|
|
|
+ // }
|
|
|
|
+ // if (this.adminId) { // 子组件,则拿传过来的参
|
|
|
|
+ // param['adminId'] = this.adminId;
|
|
|
|
+ // } else if ('admin' !== this.loginUser['username']) { //否则为主页,拿登录用户
|
|
|
|
+ // param['adminId'] = this.loginUser['id'];
|
|
|
|
+ // }
|
|
|
|
+ // if (this.equipmentId) {
|
|
|
|
+ // param['equipmentId'] = this.equipmentId;
|
|
|
|
+ // }
|
|
|
|
|
|
- return this.getProvince(param)
|
|
|
|
- .then(data => {
|
|
|
|
- uni.stopPullDownRefresh();
|
|
|
|
- if (param['chartType'] == 'day') {
|
|
|
|
- canvaColumn5 = this.initChart2('canvaColumn5', data);
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'week') {
|
|
|
|
- canvaColumn6 = this.initChart2('canvaColumn6', data);
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'month') {
|
|
|
|
- canvaColumn7 = this.initChart2('canvaColumn7', data);
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'year') {
|
|
|
|
- canvaColumn8 = this.initChart2('canvaColumn8', data);
|
|
|
|
- }
|
|
|
|
|
|
+ // return this.getProvince(param)
|
|
|
|
+ // .then(data => {
|
|
|
|
+ // uni.stopPullDownRefresh();
|
|
|
|
+ // if (param['chartType'] == 'day') {
|
|
|
|
+ // canvaColumn5 = this.initChart2('canvaColumn5', data);
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'week') {
|
|
|
|
+ // canvaColumn6 = this.initChart2('canvaColumn6', data);
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'month') {
|
|
|
|
+ // canvaColumn7 = this.initChart2('canvaColumn7', data);
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'year') {
|
|
|
|
+ // canvaColumn8 = this.initChart2('canvaColumn8', data);
|
|
|
|
+ // }
|
|
|
|
|
|
- }, _ => {
|
|
|
|
- uni.stopPullDownRefresh();
|
|
|
|
- if (param['chartType'] == 'day') {
|
|
|
|
- canvaColumn5 = this.initChart2('canvaColumn5', {
|
|
|
|
- categories: ['暂无数据'],
|
|
|
|
- series: [{
|
|
|
|
- name: '平均销售额',
|
|
|
|
- data: [0]
|
|
|
|
- }]
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'week') {
|
|
|
|
- canvaColumn6 = this.initChart2('canvaColumn6', {
|
|
|
|
- categories: ['暂无数据'],
|
|
|
|
- series: [{
|
|
|
|
- name: '平均销售额',
|
|
|
|
- data: [0]
|
|
|
|
- }]
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'month') {
|
|
|
|
- canvaColumn7 = this.initChart2('canvaColumn7', {
|
|
|
|
- categories: ['暂无数据'],
|
|
|
|
- series: [{
|
|
|
|
- name: '平均销售额',
|
|
|
|
- data: [0]
|
|
|
|
- }]
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'year') {
|
|
|
|
- canvaColumn8 = this.initChart2('canvaColumn8', {
|
|
|
|
- categories: ['暂无数据'],
|
|
|
|
- series: [{
|
|
|
|
- name: '平均销售额',
|
|
|
|
- data: [0]
|
|
|
|
- }]
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+ // }, _ => {
|
|
|
|
+ // uni.stopPullDownRefresh();
|
|
|
|
+ // if (param['chartType'] == 'day') {
|
|
|
|
+ // canvaColumn5 = this.initChart2('canvaColumn5', {
|
|
|
|
+ // categories: ['暂无数据'],
|
|
|
|
+ // series: [{
|
|
|
|
+ // name: '平均销售额',
|
|
|
|
+ // data: [0]
|
|
|
|
+ // }]
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'week') {
|
|
|
|
+ // canvaColumn6 = this.initChart2('canvaColumn6', {
|
|
|
|
+ // categories: ['暂无数据'],
|
|
|
|
+ // series: [{
|
|
|
|
+ // name: '平均销售额',
|
|
|
|
+ // data: [0]
|
|
|
|
+ // }]
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'month') {
|
|
|
|
+ // canvaColumn7 = this.initChart2('canvaColumn7', {
|
|
|
|
+ // categories: ['暂无数据'],
|
|
|
|
+ // series: [{
|
|
|
|
+ // name: '平均销售额',
|
|
|
|
+ // data: [0]
|
|
|
|
+ // }]
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'year') {
|
|
|
|
+ // canvaColumn8 = this.initChart2('canvaColumn8', {
|
|
|
|
+ // categories: ['暂无数据'],
|
|
|
|
+ // series: [{
|
|
|
|
+ // name: '平均销售额',
|
|
|
|
+ // data: [0]
|
|
|
|
+ // }]
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // },
|
|
|
|
|
|
- getProvinceAllData(chartType) {
|
|
|
|
- const param = {
|
|
|
|
- 'chartType': chartType
|
|
|
|
- };
|
|
|
|
- if (chartType == 'day') {
|
|
|
|
- param['startDate'] = this.startDate9;
|
|
|
|
- param['endDate'] = this.startDate9;
|
|
|
|
- }
|
|
|
|
- if (chartType == 'week') {
|
|
|
|
- param['startDate'] = this.startDate10;
|
|
|
|
- param['endDate'] = this.endDate10;
|
|
|
|
- }
|
|
|
|
- if (chartType == 'month') {
|
|
|
|
- param['startDate'] = this.startDate11;
|
|
|
|
- param['endDate'] = this.endDate11;
|
|
|
|
- }
|
|
|
|
- if (chartType == 'year') {
|
|
|
|
- param['startDate'] = this.startDate12;
|
|
|
|
- param['endDate'] = this.endDate12;
|
|
|
|
- }
|
|
|
|
- if (this.adminId) { // 子组件,则拿传过来的参
|
|
|
|
- param['adminId'] = this.adminId;
|
|
|
|
- } else if ('admin' !== this.loginUser['username']) { //否则为主页,拿登录用户
|
|
|
|
- param['adminId'] = this.loginUser['id'];
|
|
|
|
- }
|
|
|
|
- if (this.equipmentId) {
|
|
|
|
- param['equipmentId'] = this.equipmentId;
|
|
|
|
- }
|
|
|
|
|
|
+ // getProvinceAllData(chartType) {
|
|
|
|
+ // const param = {
|
|
|
|
+ // 'chartType': chartType
|
|
|
|
+ // };
|
|
|
|
+ // if (chartType == 'day') {
|
|
|
|
+ // param['startDate'] = this.startDate9;
|
|
|
|
+ // param['endDate'] = this.startDate9;
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType == 'week') {
|
|
|
|
+ // param['startDate'] = this.startDate10;
|
|
|
|
+ // param['endDate'] = this.endDate10;
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType == 'month') {
|
|
|
|
+ // param['startDate'] = this.startDate11;
|
|
|
|
+ // param['endDate'] = this.endDate11;
|
|
|
|
+ // }
|
|
|
|
+ // if (chartType == 'year') {
|
|
|
|
+ // param['startDate'] = this.startDate12;
|
|
|
|
+ // param['endDate'] = this.endDate12;
|
|
|
|
+ // }
|
|
|
|
+ // if (this.adminId) { // 子组件,则拿传过来的参
|
|
|
|
+ // param['adminId'] = this.adminId;
|
|
|
|
+ // } else if ('admin' !== this.loginUser['username']) { //否则为主页,拿登录用户
|
|
|
|
+ // param['adminId'] = this.loginUser['id'];
|
|
|
|
+ // }
|
|
|
|
+ // if (this.equipmentId) {
|
|
|
|
+ // param['equipmentId'] = this.equipmentId;
|
|
|
|
+ // }
|
|
|
|
|
|
- return this.getProvinceAll(param)
|
|
|
|
- .then(data => {
|
|
|
|
- uni.stopPullDownRefresh();
|
|
|
|
- if (param['chartType'] == 'day') {
|
|
|
|
- canvaColumn9 = this.initChart3('canvaColumn9', data);
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'week') {
|
|
|
|
- canvaColumn10 = this.initChart3('canvaColumn10', data);
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'month') {
|
|
|
|
- canvaColumn11 = this.initChart3('canvaColumn11', data);
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'year') {
|
|
|
|
- canvaColumn12 = this.initChart3('canvaColumn12', data);
|
|
|
|
- }
|
|
|
|
|
|
+ // return this.getProvinceAll(param)
|
|
|
|
+ // .then(data => {
|
|
|
|
+ // uni.stopPullDownRefresh();
|
|
|
|
+ // if (param['chartType'] == 'day') {
|
|
|
|
+ // canvaColumn9 = this.initChart3('canvaColumn9', data);
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'week') {
|
|
|
|
+ // canvaColumn10 = this.initChart3('canvaColumn10', data);
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'month') {
|
|
|
|
+ // canvaColumn11 = this.initChart3('canvaColumn11', data);
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'year') {
|
|
|
|
+ // canvaColumn12 = this.initChart3('canvaColumn12', data);
|
|
|
|
+ // }
|
|
|
|
|
|
- }, _ => {
|
|
|
|
- uni.stopPullDownRefresh();
|
|
|
|
- if (param['chartType'] == 'day') {
|
|
|
|
- canvaColumn9 = this.initChart3('canvaColumn9', {
|
|
|
|
- categories: ['暂无数据'],
|
|
|
|
- series: [{
|
|
|
|
- name: '销售额',
|
|
|
|
- data: [0]
|
|
|
|
- }]
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'week') {
|
|
|
|
- canvaColumn10 = this.initChart3('canvaColumn10', {
|
|
|
|
- categories: ['暂无数据'],
|
|
|
|
- series: [{
|
|
|
|
- name: '销售额',
|
|
|
|
- data: [0]
|
|
|
|
- }]
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'month') {
|
|
|
|
- canvaColumn11 = this.initChart3('canvaColumn11', {
|
|
|
|
- categories: ['暂无数据'],
|
|
|
|
- series: [{
|
|
|
|
- name: '销售额',
|
|
|
|
- data: [0]
|
|
|
|
- }]
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if (param['chartType'] == 'year') {
|
|
|
|
- canvaColumn12 = this.initChart3('canvaColumn12', {
|
|
|
|
- categories: ['暂无数据'],
|
|
|
|
- series: [{
|
|
|
|
- name: '销售额',
|
|
|
|
- data: [0]
|
|
|
|
- }]
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+ // }, _ => {
|
|
|
|
+ // uni.stopPullDownRefresh();
|
|
|
|
+ // if (param['chartType'] == 'day') {
|
|
|
|
+ // canvaColumn9 = this.initChart3('canvaColumn9', {
|
|
|
|
+ // categories: ['暂无数据'],
|
|
|
|
+ // series: [{
|
|
|
|
+ // name: '销售额',
|
|
|
|
+ // data: [0]
|
|
|
|
+ // }]
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'week') {
|
|
|
|
+ // canvaColumn10 = this.initChart3('canvaColumn10', {
|
|
|
|
+ // categories: ['暂无数据'],
|
|
|
|
+ // series: [{
|
|
|
|
+ // name: '销售额',
|
|
|
|
+ // data: [0]
|
|
|
|
+ // }]
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'month') {
|
|
|
|
+ // canvaColumn11 = this.initChart3('canvaColumn11', {
|
|
|
|
+ // categories: ['暂无数据'],
|
|
|
|
+ // series: [{
|
|
|
|
+ // name: '销售额',
|
|
|
|
+ // data: [0]
|
|
|
|
+ // }]
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // if (param['chartType'] == 'year') {
|
|
|
|
+ // canvaColumn12 = this.initChart3('canvaColumn12', {
|
|
|
|
+ // categories: ['暂无数据'],
|
|
|
|
+ // series: [{
|
|
|
|
+ // name: '销售额',
|
|
|
|
+ // data: [0]
|
|
|
|
+ // }]
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // },
|
|
initChart(canvasId, chartData) {
|
|
initChart(canvasId, chartData) {
|
|
return new uCharts({
|
|
return new uCharts({
|
|
$this: _self,
|
|
$this: _self,
|