总检统计功能
This commit is contained in:
parent
b6f54944f7
commit
11736fa216
@ -71,24 +71,51 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 总检角色和维修业务管理员 -->
|
||||
<view class="orderCount" v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')">
|
||||
<view class="orderCountItem">
|
||||
<text class="label">维修中</text>
|
||||
<text class="value">{{ bossNum.workingNum }}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="orderCountItem">
|
||||
<text class="label">在厂数</text>
|
||||
<text class="value">{{ bossNum.inCompanyNum }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')">
|
||||
<view class="body-top-tab">
|
||||
<view class="body-top-tab" >
|
||||
<view v-for="(item, index) in timePicker" @click="activeTab(index)" :key="index"
|
||||
:class="{ active: active === index }"
|
||||
class="body-top-tab-item">
|
||||
class="body-top-tab-item" style="font-weight: bold">
|
||||
{{ item }}
|
||||
<view v-if="index === active" class="activeLine"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderCount" style="margin-bottom: 0" v-if="active==2">
|
||||
<uni-datetime-picker v-model="range" type="daterange" @maskClick="maskClick" />
|
||||
</view>
|
||||
<view class="body-top-tab" style="margin-bottom: 0" v-if="active==2">
|
||||
<view v-for="(item, index) in timePickerSon" @click="activeTabSon(index)" :key="index"
|
||||
:class="{ active: activeSon === index }"
|
||||
class="body-top-tab-item">
|
||||
{{ item }}
|
||||
<view v-if="index === activeSon" class="activeLine"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderCount" >
|
||||
<view class="orderCountItem">
|
||||
<text class="label">维修中</text>
|
||||
<text class="value">{{ bossNum.workingNum }}</text>
|
||||
<text class="label">进场数</text>
|
||||
<text class="value">{{ bossNum.newOrderNum }}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="orderCountItem">
|
||||
<text class="label">已完成</text>
|
||||
<text class="value">{{ bossNum.doneNum }}</text>
|
||||
<text class="value">{{ bossNum.overNum }}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="orderCountItem">
|
||||
<text class="label">已交车</text>
|
||||
<text class="value">{{ bossNum.giveCusNum }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -104,7 +131,7 @@
|
||||
待办工单
|
||||
<text class="titleDesc">当前共
|
||||
<text class="titleCount">{{total}}</text>
|
||||
项工单需要处理
|
||||
个工单需要处理
|
||||
</text>
|
||||
</view>
|
||||
<view class="todoList">
|
||||
@ -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;
|
||||
|
@ -12,13 +12,14 @@
|
||||
<view v-for="(item, index) in tabList" :key="index" :class="{actived: item.id === activeKey}" class="tabItem"
|
||||
@click.stop="changeTabFun(item.id)">
|
||||
{{ item.title }}
|
||||
<text v-if="activeKey === item.id">({{total}})</text>
|
||||
<view v-if="activeKey === item.id" class="activeLine"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderList" v-if="!isRepairWarehouse">
|
||||
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<order-card v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @startWork="startWork"></order-card>
|
||||
<order-card :userInfo="userInfo" v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @startWork="startWork"></order-card>
|
||||
<view style="text-align: center" v-if="orderList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user