总检统计功能
This commit is contained in:
parent
b6f54944f7
commit
11736fa216
@ -71,24 +71,51 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 总检角色和维修业务管理员 -->
|
<!-- 总检角色和维修业务管理员 -->
|
||||||
<view v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')">
|
<view class="orderCount" v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')">
|
||||||
<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">
|
|
||||||
{{ item }}
|
|
||||||
<view v-if="index === active" class="activeLine"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="orderCount" >
|
|
||||||
<view class="orderCountItem">
|
<view class="orderCountItem">
|
||||||
<text class="label">维修中</text>
|
<text class="label">维修中</text>
|
||||||
<text class="value">{{ bossNum.workingNum }}</text>
|
<text class="value">{{ bossNum.workingNum }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></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 v-for="(item, index) in timePicker" @click="activeTab(index)" :key="index"
|
||||||
|
:class="{ active: active === index }"
|
||||||
|
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.newOrderNum }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="line"></view>
|
||||||
<view class="orderCountItem">
|
<view class="orderCountItem">
|
||||||
<text class="label">已完成</text>
|
<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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -104,7 +131,7 @@
|
|||||||
待办工单
|
待办工单
|
||||||
<text class="titleDesc">当前共
|
<text class="titleDesc">当前共
|
||||||
<text class="titleCount">{{total}}</text>
|
<text class="titleCount">{{total}}</text>
|
||||||
项工单需要处理
|
个工单需要处理
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="todoList">
|
<view class="todoList">
|
||||||
@ -192,9 +219,12 @@ export default {
|
|||||||
avatar: undefined,
|
avatar: undefined,
|
||||||
nickname: ''
|
nickname: ''
|
||||||
},
|
},
|
||||||
//时间可选项--总检、业务管理员用
|
//时间可选项
|
||||||
timePicker:['当日','累计'],
|
timePicker:['当日','累计','自定义时间'],
|
||||||
|
//时间子可选项
|
||||||
|
timePickerSon:['当月','近三个月','近六个月'],
|
||||||
active:0,
|
active:0,
|
||||||
|
activeSon:0,
|
||||||
menuList: [
|
menuList: [
|
||||||
{
|
{
|
||||||
title: '新建工单',
|
title: '新建工单',
|
||||||
@ -233,7 +263,10 @@ export default {
|
|||||||
//总检查看维修中、已完成的工单数量
|
//总检查看维修中、已完成的工单数量
|
||||||
bossNum:{
|
bossNum:{
|
||||||
workingNum:0,
|
workingNum:0,
|
||||||
doneNum:0
|
inCompanyNum:0,
|
||||||
|
newOrderNum:0,
|
||||||
|
overNum:0,
|
||||||
|
giveCusNum:0
|
||||||
},
|
},
|
||||||
defaultAvatar: require('@/static/icons/avatar.png'),
|
defaultAvatar: require('@/static/icons/avatar.png'),
|
||||||
//未读消息数量
|
//未读消息数量
|
||||||
@ -249,8 +282,18 @@ export default {
|
|||||||
ifLeader:false,
|
ifLeader:false,
|
||||||
//企业信息
|
//企业信息
|
||||||
companyInfo:{},
|
companyInfo:{},
|
||||||
|
//日期默认选中范围
|
||||||
|
range: ['2021-02-01', '2021-03-28'],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
range(newval) {
|
||||||
|
if(this.active==2){
|
||||||
|
this.getBossTodo()
|
||||||
|
}
|
||||||
|
console.log('范围选:', this.range);
|
||||||
|
},
|
||||||
|
},
|
||||||
onLoad(){
|
onLoad(){
|
||||||
if(!getToken()){
|
if(!getToken()){
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
@ -283,17 +326,62 @@ export default {
|
|||||||
this.getServiceTodo()
|
this.getServiceTodo()
|
||||||
}else if(this.userInfo.roleCodes.includes('weixiu') ||this.userInfo.roleCodes.includes('general_inspection')){
|
}else if(this.userInfo.roleCodes.includes('weixiu') ||this.userInfo.roleCodes.includes('general_inspection')){
|
||||||
//总检或管理员
|
//总检或管理员
|
||||||
|
this.setChooseDate("nowMonth")
|
||||||
this.getBossTodo()
|
this.getBossTodo()
|
||||||
this.getServiceTodo()
|
this.getServiceTodo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
maskClick(e){
|
||||||
|
console.log('maskClick事件:', e);
|
||||||
|
},
|
||||||
activeTab(index) {
|
activeTab(index) {
|
||||||
this.active = index
|
this.active = index
|
||||||
//刷新统计数据
|
|
||||||
this.getBossTodo()
|
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(){
|
getBossTodo(){
|
||||||
let params={
|
let params={}
|
||||||
selectType:this.active==0?"today":"all"
|
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({
|
request({
|
||||||
url: '/admin-api/repair/tickets/getBossNum',
|
url: '/admin-api/repair/tickets/getBossNum',
|
||||||
@ -914,7 +1020,7 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
.titleDesc {
|
.titleDesc {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 24rpx;
|
font-size: 28rpx;
|
||||||
color: #858BA0;
|
color: #858BA0;
|
||||||
}
|
}
|
||||||
.titleNumber{
|
.titleNumber{
|
||||||
@ -955,7 +1061,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.orderCount {
|
.orderCount {
|
||||||
margin: 0 40rpx 32rpx;
|
margin: 0 40rpx 18rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
|
@ -12,13 +12,14 @@
|
|||||||
<view v-for="(item, index) in tabList" :key="index" :class="{actived: item.id === activeKey}" class="tabItem"
|
<view v-for="(item, index) in tabList" :key="index" :class="{actived: item.id === activeKey}" class="tabItem"
|
||||||
@click.stop="changeTabFun(item.id)">
|
@click.stop="changeTabFun(item.id)">
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
|
<text v-if="activeKey === item.id">({{total}})</text>
|
||||||
<view v-if="activeKey === item.id" class="activeLine"></view>
|
<view v-if="activeKey === item.id" class="activeLine"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="orderList" v-if="!isRepairWarehouse">
|
<view class="orderList" v-if="!isRepairWarehouse">
|
||||||
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
|
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
|
||||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
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">
|
<view style="text-align: center" v-if="orderList.length==0">
|
||||||
<image class="" src="@/static/images/nothing.png" ></image>
|
<image class="" src="@/static/images/nothing.png" ></image>
|
||||||
</view>
|
</view>
|
||||||
@ -85,6 +86,7 @@ export default {
|
|||||||
orderList: [
|
orderList: [
|
||||||
],
|
],
|
||||||
repairSoList: [],
|
repairSoList: [],
|
||||||
|
userInfo:{},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@ -344,7 +346,7 @@ export default {
|
|||||||
z-index: 9999999;
|
z-index: 9999999;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 24rpx;
|
font-size: 28rpx;
|
||||||
|
|
||||||
&.actived {
|
&.actived {
|
||||||
color: #0174F6;
|
color: #0174F6;
|
||||||
|
@ -688,6 +688,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.uni-calendar__content-mobile {
|
.uni-calendar__content-mobile {
|
||||||
|
margin-bottom: 100rpx;
|
||||||
border-top-left-radius: 10px;
|
border-top-left-radius: 10px;
|
||||||
border-top-right-radius: 10px;
|
border-top-right-radius: 10px;
|
||||||
box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.1);
|
box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.1);
|
||||||
|
Loading…
Reference in New Issue
Block a user