Ver Fonte

消息提醒

zhengkaixin há 2 anos atrás
pai
commit
5ccc2a8d16

+ 10 - 0
apis/pagejs/index.js

@@ -2,6 +2,16 @@ import requestWhite from '@/apis/utils/requestWhite'
  import request from '@/apis/utils/request'
  
 
+export function urlgetlisg(data,url) {
+	//var url = '/mobile/out/outApproveList';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+
 export function outApproveList(data) {
 	var url = '/mobile/out/outApproveList';
 	return request({

+ 0 - 69
apis/utils/mixin.js

@@ -1,78 +1,14 @@
 var prefix = process.car.PREFIX+'-' + process.car.NODE_ENV + '_';
 
 var app = {
-	getGzDate : (key) => {
-		var tdate=new Date( ).toJSON().substr(0,10).replace("T"," ")
-		var date= uni.getStorageSync( prefix + "is_gz_date")
-		
-		if(tdate==date){
-			return false
-		}else{
-			return  true;
-		}
-		
-	},
-	
-	setGzDate : () => uni.setStorageSync(prefix + "is_gz_date", new Date( ).toJSON().substr(0,10).replace("T"," ") ),
-	
-	getGunIdCharge :()=>{
-
-		var date= uni.getStorageSync( prefix + "GunId_Date_charge")
-		var now=new Date().getTime()
-		if(date+5*60*1000>now){
-			return  uni.getStorageSync(prefix +  "GunId_Date_Show_charge")
-		}else{
-			return "";
-		}
-	},
 	
-	setGunIdCharge : ( value) => {
-		uni.setStorageSync(prefix + "GunId_Date_Show_charge", value)
-		uni.setStorageSync(prefix + "GunId_Date_charge", new Date().getTime())
-		
-	},
-	// getGunId :()=>{
-	// 	var date= uni.get( "GunId_Date")
-	// 	var now=new Date().getTime()
-	// 	if(date+5*60*1000<now){
-	// 		return  uni.get( "GunId_Date_Show")
-	// 	}else{
-	// 		return "";
-	// 	}
-	// },
-	
-	// setGunId : ( value) => {
-	// 	uni.setStorageSync(prefix + "GunId_Date_Show", value)
-	// 	uni.setStorageSync(prefix + "GunId_Date", new Date().getTime())
-		
-	// },
 	
 	getPrefix:()=> prefix,
 	get : key =>  uni.getStorageSync(prefix + key),
 
 	set : (key, value) => uni.setStorageSync(prefix + key, value),
 	remove: key =>  uni.removeStorageSync(prefix + key),
-	setConfig : (value) => uni.setStorageSync(prefix + '_config_$', value),
-	getConfig : () => {
-		var config = uni.getStorageSync(prefix + '_config_$')
-		var configure={}
-		if(config){
-			for(var  i in config){
-				var con=config[i];
-				configure[con.key]=con.value
-			}
-		}
-		 return configure;
-	},
 	
-	setConfigMessage : (value) => uni.setStorageSync(prefix + '_config_tips_$', value),
-	getConfigMessage : () => {
-		var config = uni.getStorageSync(prefix + '_config_tips_$')
-		if(!config){
-			config=[]
-		}
-		 return config;
-	},
 	
 	logoff:()=>{
 		uni.removeStorageSync(prefix + 'token_tdate')
@@ -119,11 +55,6 @@ var app = {
 			uni.setStorageSync(prefix + 'token_tdate', tdate)
 		}
 	}
-	,
-	getGetElderModeClass : () => {
-		 return uni.getStorageSync(prefix + 'getElderModeClass')
-	},
-	setGetElderModeClass : (value) => uni.setStorageSync(prefix + 'getElderModeClass', value),
 	
 }
 

+ 1 - 0
config/.env.dev.js

@@ -14,6 +14,7 @@ const UNI_APP = {
 	
 	//openId:"oBA__5QB2nHNNef3xshMJ3GcR2Hw",
 	openId:"oBA__5UuQTRx5Q8h94bDPY-GO2SM",//zkx
+	//openId:"oBA__5UuQTRx5Q8h94bDPY-GO2SM---",
 	//openId:"123456",//库管理
 	//openId:"123",// 项目部 - 审批1
 	//openId:"223",// 项目部 - 审批2

+ 122 - 33
pages/otherFunctions/homePage.vue

@@ -47,7 +47,10 @@
 			
 				<view class="item"  @click="gotoUrl('pages/projectDepartment/exportProcess/exportProcess')">
 					<view class="title">
-						<u-badge type="error" :count="badgeexportProcess"></u-badge>出库审核
+						出库审核
+						<u-badge type="error" style="    position: unset;    padding: 2px 3px;" :fontSize="36"
+						
+						:isCenter="true" :count="badgeGet.outApproveList"></u-badge>
 					</view>
 					<view class="hint">
 						审批出库申请单据
@@ -65,6 +68,7 @@
 			<view class="item"  @click="gotoUrl('pages/projectDepartment/exportApplication/exportApplication')">
 				<view class="title">
 					出库申请
+					
 				</view>
 				<view class="hint">
 					提交出库申请单据
@@ -77,6 +81,7 @@
 			<view class="item"  @click="gotoUrl('pages/projectDepartment/exportReturn/exportReturn')">
 				<view class="title">
 					设备归还
+					 
 				</view>
 				<view class="hint">
 					提交设备归还单据
@@ -86,17 +91,7 @@
 				</view>
 			</view>
 				</template>
-			<view class="item"  @click="gotoUrl('pages/otherFunctions/equipmentRetrieval/equipmentRetrieval')">
-				<view class="title">
-					设备检索
-				</view>
-				<view class="hint">
-					库存物品信息检索
-				</view>
-				<view class="img">
-					<img src="@/assets/img/projectGird4.png" alt="">
-				</view>
-			</view>
+			
 			
 		
 		<template  v-if="role('1')">
@@ -105,6 +100,9 @@
 		<view class="item" @click="gotoUrl('pages/storeManagement/equipmentDelivery/equipmentDelivery')">
 			<view class="title">
 				设备出库
+				<u-badge type="error" style="    position: unset;    padding: 2px 3px;" :fontSize="36"
+				
+				:isCenter="true" :count="badgeGet.outWaitList"></u-badge>
 			</view>
 			<view class="hint">
 				申请物品登记核准出库
@@ -116,6 +114,9 @@
 		<view class="item"  @click="gotoUrl('pages/storeManagement/equipmentEnter/equipmentEnter')">
 			<view class="title">
 				设备入库
+				<u-badge type="error" style="    position: unset;    padding: 2px 3px;" :fontSize="36"
+				
+				:isCenter="true" :count="badgeGet.inWaitList"></u-badge>
 			</view>
 			<view class="hint">
 				申购采购收货入库登记
@@ -127,6 +128,9 @@
 		<view class="item"   @click="gotoUrl('pages/storeManagement/equipmentInspection/equipmentInspection')" >
 			<view class="title">
 				设备巡检
+				<u-badge type="error" style="    position: unset;    padding: 2px 3px;" :fontSize="36"
+				
+				:isCenter="true" :count="badgeGet.deviceList"></u-badge>
 			</view>
 			<view class="hint">
 				当前物品计量库存盘点
@@ -137,7 +141,17 @@
 		</view>
 				
 			</template>
-			
+			<view class="item"  @click="gotoUrl('pages/otherFunctions/equipmentRetrieval/equipmentRetrieval')">
+				<view class="title">
+					设备检索
+				</view>
+				<view class="hint">
+					库存物品信息检索
+				</view>
+				<view class="img">
+					<img src="@/assets/img/projectGird4.png" alt="">
+				</view>
+			</view>
 			</view>
 			
 		<!-- 其他功能 -->
@@ -179,7 +193,53 @@
 				badgeexportProcess:0,
 				userInfo:{
 					name:""
-				}
+				},
+				badgeGet:{
+					
+				},
+				badgeList:[
+					{
+						url:"/mobile/out/outApproveList",
+						role:"3",
+						key:"outApproveList",
+						page:{
+							pageIndex: 1,
+							pageSize: 0,
+							status: 0,
+						}
+					},
+					{
+						url:"/mobile/out/outWaitList",
+						role:"1",
+						key:"outWaitList",
+						page:{
+							pageIndex: 1,
+							pageSize: 0,
+							status: 0,
+						}
+					},
+					{
+						url:"/mobile/in/inWaitList",
+						role:"1",
+						key:"inWaitList",
+						page:{
+							pageIndex: 1,
+							pageSize: 0,
+							status: 0,
+						}
+					},
+					{
+						url:"/mobile/inspection/deviceList",
+						role:"1",
+						key:"deviceList",
+						page:{
+							pageIndex: 1,
+							pageSize: 0,
+							healthStatus: 5,
+						}
+					}
+					
+				]
 			}
 		},
 		components:{
@@ -191,7 +251,7 @@
 			this.getInfo()
 		},
 		onReady() {
-			console.log("onReady")
+			
 			// #ifdef MP-WEIXIN
 			wx.getSetting({
 			  success: res => {
@@ -212,32 +272,61 @@
 			// #endif
 		},
 		onShow(){
-			if(this.role("3")){
-				
-				API.outApproveList({
-					pageIndex: 1,
-					pageSize: 1,
-				
-					status: 0,
-				}).then((res) => {
-					
-					this.badgeexportProcess=res.data.recordsTotal
-				}).catch(error => {
-					uni.showToast({
-						title: error
-					})
-				})
-				
-			}
+			this.badgeGetMethodApi()
 			
 		},
+		
 		methods: {
+			
+			badgeGetMethodApi(){
+				var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
+				var token_tdate=this.carhelp.get("badgeGet_token_tdate");//每60分钟存储一次token
+				if(token_tdate&&token_tdate==tdate){
+					this.badgeGetMethod();
+					this.$forceUpdate()
+				}else{
+					
+					
+					for(var i in this.badgeList){
+						var obj=this.badgeList[i]
+						console.log(this.role(obj.role),obj.role)
+						if(this.role(obj.role)){
+							this.carhelp.set("badgeGet_token_tdate",tdate);
+							this.urlgetlisg(obj)
+						}
+						
+					}
+					
+				}
+			},
+			urlgetlisg(obj){
+				API.urlgetlisg(obj.page,obj.url).then((res) => {
+				
+					var count=res.data.recordsTotal;
+					this.badgeGet[obj.key]=count;
+					this.carhelp.set("badgeList_"+obj.key,count)
+					this.$forceUpdate()
+				}).catch(error => {
+					
+					
+				})
+			},
+			badgeGetMethod(){
+				for(var i in this.badgeList){
+					var obj=this.badgeList[i]
+					this.badgeGet[obj.key]=this.carhelp.get("badgeList_"+obj.key);
+					
+				}
+			},
 			error(e) {
 			           console.log(e);
 			},
 			role(val){
+				
 				if(this.userInfo.type!=null&&this.userInfo.type!=undefined){
+					
 					var index=this.userInfo.type.split(',').indexOf(val)
+					
 					return index>-1
 				}else{
 					return false
@@ -253,7 +342,7 @@
 					
 					this.carhelp.setPersonInfo(res.data.regUser );
 					this.userInfo=this.carhelp.getPersonInfo()
-					
+					this.badgeGetMethodApi()
 					
 					
 				}).catch(error => {

+ 4 - 0
pages/projectDepartment/exportProcess/exportProcess.vue

@@ -119,6 +119,10 @@
 								this.list[this.current].list=list
 						
 							 	this.list[this.current].recordsTotal = res.data.recordsTotal;
+								if(this.current==0){
+									this.carhelp.set("badgeList_outApproveList",res.data.recordsTotal)
+								}
+								
 								if(val!='init'){
 									uni.hideLoading();
 								}

+ 1 - 1
pages/projectDepartment/exportReturn/deliveryFrom.vue

@@ -193,7 +193,7 @@
 				
 				},
 				address:"",
-				showpopup:true,
+				showpopup:false,
 				deviceposition:"back",
 				
 				form:{

+ 3 - 0
pages/storeManagement/equipmentDelivery/equipmentDelivery.vue

@@ -111,6 +111,9 @@
 										...res.data.data
 									];
 								}
+								if(this.current==0){
+									this.carhelp.set("badgeList_outWaitList",res.data.recordsTotal)
+								}
 							 	this.list[this.current].list=list
 							 	
 							 	this.list[this.current].recordsTotal = res.data.recordsTotal;

+ 3 - 1
pages/storeManagement/equipmentEnter/equipmentEnter.vue

@@ -144,7 +144,9 @@
 									];
 								}
 							 	this.list[this.current].list=list
-							 	
+							 	if(this.current==0){
+							 		this.carhelp.set("badgeList_inWaitList",res.data.recordsTotal)
+							 	}
 							 	this.list[this.current].recordsTotal = res.data.recordsTotal;
 							 }).catch(error => {
 							 	uni.showToast({

+ 4 - 1
pages/storeManagement/equipmentInspection/equipmentInspection.vue

@@ -159,7 +159,7 @@
 			getNum(){
 				API.deviceList({
 					pageIndex: 1,
-					pageSize: 1,
+					pageSize: 0,
 					healthStatus: 6,
 				
 				}).then((res) => {
@@ -207,6 +207,9 @@
 						if(this.list[this.current].iscount){
 							this.list[this.current].count=res.data.recordsTotal
 						}
+						if(this.current==0){
+							this.carhelp.set("badgeList_deviceList",res.data.recordsTotal)
+						}
 						this.list[this.current].list = list
 					
 						this.list[this.current].recordsTotal = res.data.recordsTotal;

+ 1 - 1
uni_modules/uview-ui/components/u-badge/u-badge.vue

@@ -1,5 +1,5 @@
 <template>
-	<view v-if="show" class="u-badge" :class="[
+	<view v-if="show&&showText" class="u-badge" :class="[
 			isDot ? 'u-badge-dot' : '', 
 			size == 'mini' ? 'u-badge-mini' : '',
 			type ? 'u-badge--bg--' + type : ''