Browse Source

优化页面

zhengkaixin 2 years ago
parent
commit
dd5d6f27c5

+ 3 - 0
apis/status.js

@@ -49,6 +49,9 @@ export const recordStatusColor = (val) => {
 		case '5':
 			retu = '#c94031'
 			break;
+		case '6':
+			retu = '#c94031'
+			break;
 		default:
 			retu = '#52b56b'
 			break;

+ 35 - 2
main.js

@@ -25,7 +25,10 @@ Vue.prototype.carhelp = mixin
 import uView from '@/uni_modules/uview-ui'
 
 Vue.use(uView);
-
+
+import {
+		afterTimeStamp,parseUnixTime,newDate,daysDistance
+} from '@/apis/utils'
 
 Vue.mixin({
 	updated: function() {
@@ -42,7 +45,37 @@ Vue.mixin({
 
 	},
 	methods: {
-		
+		gotoInfo(id){
+				if(id){
+					uni.navigateTo({
+						url:'/pages/otherFunctions/equipmentRetrieval/equipmentInfo?id='+id
+					})
+				}
+		},
+		descriptionKey(info,bl){
+			var key=''
+			if(info.experimentPeriod&&info.experimentLastTime){
+				var time=parseUnixTime(afterTimeStamp(info.experimentPeriod,newDate(info.experimentLastTime)),'{y}-{m}-{d}');
+				var saytime=daysDistance(new Date(),time);
+				var color="red";
+				if(saytime>30){
+					color="#4caf50";
+				}else if(saytime>10){
+					color="#ff9800";
+				}
+				key=`下次巡检${time},距离下次还剩`;
+				if(!bl){
+					key+=`<span style="color:${color}">`
+				}
+				
+				key+=`${saytime}`
+				if(!bl){
+					key+=`</span>`
+				}
+				key+=`天`
+			}
+			return key
+		},
 		takeCodeJp(val){
 			if(val&&val.indexOf("jp=")==0){
 				val=val.split("jp=")[1]

+ 6 - 1
pages/otherFunctions/equipmentRetrieval/equipmentInfo.vue

@@ -146,7 +146,9 @@
 					</view>
 					</view>
 					
-					
+					<view class="inspection-contents" v-if="inspectionRecordDeviceList.length==0">
+						暂无
+					</view>
 					<view class="inspection-contents" v-for="(item,index) in inspectionRecordDeviceList" 
 					 v-show="index<3||inspectionRecordDeviceListShow"
 					 
@@ -196,6 +198,9 @@
 						<u-icon :name="outRecordListShow?'arrow-up':'arrow-down'"></u-icon>
 					</view>
 					</view>
+					<view class="records" v-if="outRecordList.length==0">
+						暂无
+					</view>
 					<view class="records" v-for="(item,index) in outRecordList"
 					 v-show="index<3||outRecordListShow"
 					 

+ 4 - 0
pages/otherFunctions/homePage.vue

@@ -833,7 +833,11 @@
  			.infos-item {
  				display: flex;
  				margin-bottom: 8rpx;
+				.item-value{
+					max-width: 200rpx;
+				}
  			}
+			
  		}
  	}
  }

+ 3 - 0
pages/projectDepartment/exportApplication/deliveriedList.vue

@@ -291,6 +291,9 @@
 				.infos-item {
 					display: flex;
 					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 
 			}

+ 4 - 1
pages/projectDepartment/exportApplication/deliveryDetails.vue

@@ -131,7 +131,7 @@
 	<view class="bottom" >
 		<!-- <button>确认出库</button> -->
 		<u-button  v-if="info.status==0" type="revoke" @click="revokeBtn" >撤销</u-button>
-		<u-button   v-if="info.status==1" type="primary" >签字验收</u-button>
+		<u-button   v-if="info.status==1&&false" type="primary" >签字验收</u-button>
 	</view>
 	</view>
 </template>
@@ -402,6 +402,9 @@
 				.infos-item {
 					display: flex;
 					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 			}
 		}

+ 3 - 0
pages/projectDepartment/exportApplication/deliveryFrom.vue

@@ -649,6 +649,9 @@
 				.infos-item {
 					display: flex;
 					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 			}
 		}

+ 3 - 0
pages/projectDepartment/exportProcess/deliveryDetails.vue

@@ -589,6 +589,9 @@
 				.infos-item {
 					display: flex;
 					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 			}
 		}

+ 3 - 0
pages/projectDepartment/exportProcess/deliveryInfo.vue

@@ -353,6 +353,9 @@
 				.infos-item {
 					display: flex;
 					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 			}
 		}

+ 3 - 0
pages/projectDepartment/exportReturn/deliveryDetails.vue

@@ -322,6 +322,9 @@
 				.infos-item {
 					display: flex;
 					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 			}
 		}

+ 3 - 0
pages/projectDepartment/exportReturn/deliveryFrom.vue

@@ -548,6 +548,9 @@
 				.infos-item {
 					display: flex;
 					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 			}
 		}

+ 58 - 37
pages/storeManagement/equipmentDelivery/deliveriedList.vue

@@ -425,13 +425,48 @@
 					url: url,
 				
 				})
-			},
-			gotoOut() {
-				//recordData
+			},
+			gotoOutMethod(list) {
+				var obj={
+					"recordId":this.id,
+					"deviceData":list,
+				}
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
+				})		
+				
+				API.saveRecordOut({
+					recordData: JSON.stringify(obj),
+				
+				}).then((res) => {
+					this.status=3;
+					const eventChannel = this.getOpenerEventChannel();
+					  eventChannel.emit('refreshData');
+					  uni.hideLoading()
+					uni.showModal({
+						title: '提示',
+						content: '操作成功',
+						showCancel:false,
+						success: function (res) {
+							if (res.confirm) {
+								
+								uni.navigateBack()
+							} else if (res.cancel) {
+								console.log('用户点击取消');
+							}
+						}
+					});
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
 				})
+			},
+			gotoOut() {
+				//recordData
+			
 				var list=[];
 				var bl=true;
 				this.list.forEach(item=>{
@@ -457,43 +492,23 @@
 					
 				})
 				if(!bl){
-					uni.hideLoading();
+					//uni.hideLoading();
 					return;
 				}
 				
-				var obj={
-					"recordId":this.id,
-					"deviceData":list,
-				}
-			
-				
-				API.saveRecordOut({
-					recordData: JSON.stringify(obj),
-				
-				}).then((res) => {
-					this.status=3;
-					const eventChannel = this.getOpenerEventChannel();
-					  eventChannel.emit('refreshData');
-					  uni.hideLoading()
-					uni.showModal({
-						title: '提示',
-						content: '操作成功',
-						showCancel:false,
-						success: function (res) {
-							if (res.confirm) {
-								
-								uni.navigateBack()
-							} else if (res.cancel) {
-								console.log('用户点击取消');
-							}
+				var _this=this;
+				uni.showModal({
+					title: '提示',
+					content:"确认清单无误",
+					//content: '这是一个模态弹窗',
+					success: function(res) {
+						if (res.confirm) {
+							_this.gotoOutMethod(list)
+						} else if (res.cancel) {
+							console.log('用户点击取消');
 						}
-					});
-				}).catch(error => {
-					uni.showToast({
-						title: error,
-						icon: "none"
-					})
-				})
+					}
+				});
 			},
 			 error(e) {
 			            console.log(e);
@@ -821,6 +836,9 @@
 					.infos-item {
 						display: flex;
 						margin-bottom: 8rpx;
+						.item-value{
+							max-width: 200rpx;
+						}
 					}
 		
 				}
@@ -898,7 +916,10 @@
 
 				.infos-item {
 					display: flex;
-					margin-bottom: 8rpx;
+					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 
 			}

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

@@ -439,6 +439,9 @@
 				.infos-item {
 					display: flex;
 					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 			}
 		}

+ 9 - 0
pages/storeManagement/equipmentEnter/deliveryDetails.vue

@@ -621,6 +621,9 @@
 				.infos-item {
 					display: flex;
 					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 	
 			}
@@ -722,6 +725,9 @@
 					.infos-item {
 						display: flex;
 						margin-bottom: 8rpx;
+						.item-value{
+							max-width: 200rpx;
+						}
 					}
 				}
 			}
@@ -930,6 +936,9 @@
 				.infos-item {
 					display: flex;
 					margin-bottom: 8rpx;
+					.item-value{
+						max-width: 200rpx;
+					}
 				}
 			}
 		}

+ 3 - 2
pages/storeManagement/equipmentInspection/inspectionRecord.vue

@@ -238,9 +238,10 @@
 					.infos-item {
 						display: flex;
 						margin-bottom: 8rpx;
-
+						
 						.item-value {
-							width: 200rpx;
+							//width: 200rpx;
+							max-width: 200rpx;
 							overflow: hidden;
 							white-space: nowrap;
 							text-overflow: ellipsis;