|
@@ -122,10 +122,15 @@
|
|
|
beforeTimeStamp,
|
|
|
getWeek
|
|
|
} from '@/apis/utils'
|
|
|
+ import * as API_workOrder from '@/apis/pagejs/workOrder.js'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ createdNum: 0,
|
|
|
+ dispatchedNum: 0,
|
|
|
+ endedNum: 0,
|
|
|
+ closedNum: 0,
|
|
|
workForm: {
|
|
|
qkey: '',
|
|
|
startDate: '',
|
|
@@ -154,25 +159,51 @@
|
|
|
this.weekStart = parseUnixTime(firstDay, '{y}-{m}-{d}');
|
|
|
this.weekEnd = parseUnixTime(lastDay, '{y}-{m}-{d}');
|
|
|
|
|
|
+ const start = new Date(today.getFullYear(), today.getMonth(), 1);
|
|
|
+ const end = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
|
|
+ this.monthStart = parseUnixTime(start, '{y}-{m}-{d}');
|
|
|
+ this.monthEnd = parseUnixTime(end, '{y}-{m}-{d}');
|
|
|
console.log('当天:'+this.today+'\n'+'一周:'+this.weekStart+'至'+this.weekEnd+'\n'
|
|
|
+'一月:'+this.monthStart+'至'+this.monthEnd)
|
|
|
+
|
|
|
+ this.workForm.startDate = this.today;
|
|
|
+ this.workForm.endDate = this.today;
|
|
|
+ this.getRptByStatus();
|
|
|
},
|
|
|
onReady() {
|
|
|
this.getBarCharts();
|
|
|
},
|
|
|
methods: {
|
|
|
+ getRptByStatus() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ API_workOrder.rptByStatus(this.workForm).then((res) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
//选择时间
|
|
|
tabsClick(item,index) {
|
|
|
this.tabsIndex = index;
|
|
|
- if(index == 0) {
|
|
|
- this.workForm.startDate = this.today;
|
|
|
- this.workForm.endDate = this.today;
|
|
|
- } else if(index == 1) {
|
|
|
- this.workForm.startDate = this.weekStart;
|
|
|
- this.workForm.endDate = this.weekEnd;
|
|
|
- } else if(index == 2) {
|
|
|
- this.workForm.startDate = this.monthStart;
|
|
|
- this.workForm.endDate = this.monthEnd;
|
|
|
+ if(index != 3) {
|
|
|
+ if(index == 0) {
|
|
|
+ this.workForm.startDate = this.today;
|
|
|
+ this.workForm.endDate = this.today;
|
|
|
+ } else if(index == 1) {
|
|
|
+ this.workForm.startDate = this.weekStart;
|
|
|
+ this.workForm.endDate = this.weekEnd;
|
|
|
+ } else {
|
|
|
+ this.workForm.startDate = this.monthStart;
|
|
|
+ this.workForm.endDate = this.monthEnd;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.getRptByStatus();
|
|
|
} else {
|
|
|
this.show = true;
|
|
|
}
|