From 11736fa21673ebe1ff71c4ac7ddc450f4ea73f95 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Mon, 18 Nov 2024 18:05:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=BB=E6=A3=80=E7=BB=9F=E8=AE=A1=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages-home/home/home.vue | 134 ++++++++++++++++-- pages-order/orderList/orderList.vue | 6 +- .../uni-datetime-picker/calendar.vue | 1 + 3 files changed, 125 insertions(+), 16 deletions(-) diff --git a/pages-home/home/home.vue b/pages-home/home/home.vue index e8d22e7..e063485 100644 --- a/pages-home/home/home.vue +++ b/pages-home/home/home.vue @@ -71,24 +71,51 @@ + + + 维修中 + {{ bossNum.workingNum }} + + + + 在厂数 + {{ bossNum.inCompanyNum }} + + - + + class="body-top-tab-item" style="font-weight: bold"> {{ item }} + + + + + + {{ item }} + + + - 维修中 - {{ bossNum.workingNum }} + 进场数 + {{ bossNum.newOrderNum }} 已完成 - {{ bossNum.doneNum }} + {{ bossNum.overNum }} + + + + 已交车 + {{ bossNum.giveCusNum }} @@ -104,7 +131,7 @@ 待办工单 当前共 {{total}} - 项工单需要处理 + 个工单需要处理 @@ -192,9 +219,12 @@ export default { avatar: undefined, nickname: '' }, - //时间可选项--总检、业务管理员用 - timePicker:['当日','累计'], + //时间可选项 + timePicker:['当日','累计','自定义时间'], + //时间子可选项 + timePickerSon:['当月','近三个月','近六个月'], active:0, + activeSon:0, menuList: [ { title: '新建工单', @@ -233,7 +263,10 @@ export default { //总检查看维修中、已完成的工单数量 bossNum:{ workingNum:0, - doneNum:0 + inCompanyNum:0, + newOrderNum:0, + overNum:0, + giveCusNum:0 }, defaultAvatar: require('@/static/icons/avatar.png'), //未读消息数量 @@ -249,8 +282,18 @@ export default { ifLeader:false, //企业信息 companyInfo:{}, + //日期默认选中范围 + range: ['2021-02-01', '2021-03-28'], } }, + watch: { + range(newval) { + if(this.active==2){ + this.getBossTodo() + } + console.log('范围选:', this.range); + }, + }, onLoad(){ if(!getToken()){ uni.reLaunch({ @@ -283,17 +326,62 @@ export default { this.getServiceTodo() }else if(this.userInfo.roleCodes.includes('weixiu') ||this.userInfo.roleCodes.includes('general_inspection')){ //总检或管理员 + this.setChooseDate("nowMonth") this.getBossTodo() this.getServiceTodo() } } }, methods: { + maskClick(e){ + console.log('maskClick事件:', e); + }, activeTab(index) { this.active = index - //刷新统计数据 this.getBossTodo() }, + activeTabSon(index) { + this.activeSon = index + //设置选中日期 + if(0==this.activeSon){ + //当月 + this.setChooseDate("nowMonth") + }else if(1==this.activeSon){ + //近3个月 + this.setChooseDate("threeMonth") + }else if(2==this.activeSon){ + //近半年 + this.setChooseDate("sixMonth") + } + }, + //设置选中日期 + setChooseDate(type){ + var currentDate = new Date(); + var year = currentDate.getFullYear(); + var month = currentDate.getMonth() + 1; // 返回的月份从0开始,需要加1 + var startStr; + var endStr; + if("nowMonth"==type){ + //当月 + //当月第一天 + startStr = year + "-" + month + "-01"; + //当天 + const day = currentDate.getDate(); + endStr = year + "-" + month +"-"+ day; + this.range = [startStr,endStr] + }else{ + //近3个月或近半年 + request({ + url: '/admin-api/repair/tickets/getDateRange', + method: 'GET', + params:{selectType:type} + }).then((res) => { + if (res.code == 200){ + this.range = [res.data.startDate,res.data.endDate] + } + }) + } + }, /** * 作废 */ @@ -582,8 +670,26 @@ export default { * 从总检的角度差维修中、已完成的工单数量 */ getBossTodo(){ - let params={ - selectType:this.active==0?"today":"all" + let params={} + if(this.active==0){ + //当日 + params.selectType="today" + }else if(this.active==1){ + //累计 + params.selectType="all" + }else{ + //自定义时间 + params.selectType="customer" + if(this.range.length==2){ + params.startDate = this.range[0] + params.endDate = this.range[1] + }else{ + uni.showToast({ + title: '请选择查询日期范围', + icon: 'none' + }) + return + } } request({ url: '/admin-api/repair/tickets/getBossNum', @@ -914,7 +1020,7 @@ export default { text-align: center; .titleDesc { font-weight: 500; - font-size: 24rpx; + font-size: 28rpx; color: #858BA0; } .titleNumber{ @@ -955,7 +1061,7 @@ export default { } } .orderCount { - margin: 0 40rpx 32rpx; + margin: 0 40rpx 18rpx; background: #FFFFFF; border-radius: 8rpx 8rpx 8rpx 8rpx; padding: 20rpx; diff --git a/pages-order/orderList/orderList.vue b/pages-order/orderList/orderList.vue index ba848bb..a8ea724 100644 --- a/pages-order/orderList/orderList.vue +++ b/pages-order/orderList/orderList.vue @@ -12,13 +12,14 @@ {{ item.title }} + ({{total}}) - + @@ -85,6 +86,7 @@ export default { orderList: [ ], repairSoList: [], + userInfo:{}, } }, onShow() { @@ -344,7 +346,7 @@ export default { z-index: 9999999; text-align: center; position: relative; - font-size: 24rpx; + font-size: 28rpx; &.actived { color: #0174F6; diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue index 0f9e121..665a9f2 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue @@ -688,6 +688,7 @@ } .uni-calendar__content-mobile { + margin-bottom: 100rpx; border-top-left-radius: 10px; border-top-right-radius: 10px; box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.1);