littlegreen 1 anno fa
parent
commit
c831c95fa0

+ 63 - 35
pages/borrow/borrow.vue

@@ -199,7 +199,7 @@
 			this.init()
 			this.init()
 		},
 		},
 		onShow() {
 		onShow() {
-			this.initAssets(this.form.assetBarCode)
+			this.initAssets(this.form.assetBarCode,0,"加载中")
 		},
 		},
 		methods:{
 		methods:{
 			showBor(){
 			showBor(){
@@ -249,28 +249,45 @@
 				this.form.returnDate = dateToString(new Date(new Date().getTime() + 1000*60*15))
 				this.form.returnDate = dateToString(new Date(new Date().getTime() + 1000*60*15))
 				this.form.tel = cache.session.getJSON("phone")
 				this.form.tel = cache.session.getJSON("phone")
 			},
 			},
-			initAssets(data){
-				searchAsset({barCode: data}).then(res=>{
-					if(res.barCode===null){
-						this.$refs.uToast.show({
-							type: 'error',
-							icon: false,
-							message: "该设备不存在,即将返回上一页",
-							duration:1500
-						})
-						setTimeout(()=>{
-							uni.navigateBack({
-								delta:1
-							})
-						},1400)
-					}
-					if(res.meBorrow || res.borrowStatus ==="可借出"){
-						this.show = true;
-					}else{
-						this.show = false;
-					}
-					this.assetObj = res
+			initAssets(data,num,str){
+				uni.showLoading({
+					title:str,
+					icon:'none',
+					mask:true
 				})
 				})
+				try{
+					searchAsset({barCode: data}).then(res=>{
+						if(res.barCode===null){
+							uni.hideLoading()
+							this.$refs.uToast.show({
+								type: 'error',
+								icon: false,
+								message: "该设备不存在,即将返回上一页",
+								duration:1500
+							})
+							setTimeout(()=>{
+								uni.navigateBack({
+									delta:1
+								})
+							},1400)
+						}
+						if(res.meBorrow || res.borrowStatus ==="可借出"){
+							this.show = true;
+						}else{
+							this.show = false;
+						}
+						uni.hideLoading()
+						if(num===1){
+							uni.$u.toast('借用成功!')
+						}else if(num===2){
+							uni.$u.toast('归还成功!')
+						}
+						this.assetObj = res
+					})
+				}catch(err){
+					uni.hideLoading()
+				}
+				
 			},
 			},
 			showPlace(){
 			showPlace(){
 				this.placeShow = true
 				this.placeShow = true
@@ -287,18 +304,21 @@
 				})
 				})
 			},
 			},
 			toBorrowAsset(){
 			toBorrowAsset(){
-				// uni.showLoading({
-				// 	title: "正在借用中",
-				// 	mask: true,
-				// });
+				uni.showLoading({
+					title: "正在借用中",
+					mask: true,
+				});
 				if(this.form.tel===""){
 				if(this.form.tel===""){
 					uni.showToast({
 					uni.showToast({
 						icon:"none",
 						icon:"none",
-						title:"请输入正确的手机号"
+						title:"请输入正确的手机号",
+						mask:true
 					})
 					})
+					uni.hideLoading()
 					return;
 					return;
 				}
 				}
 			  	if(!this.handleDate(this.form.borrowDate,this.form.returnDate)){
 			  	if(!this.handleDate(this.form.borrowDate,this.form.returnDate)){
+					uni.hideLoading()
 					return;
 					return;
 				}
 				}
 				
 				
@@ -311,13 +331,20 @@
 				// console.log(data,1)
 				// console.log(data,1)
 				let returnDate = new Date(this.form.returnDate).getTime()
 				let returnDate = new Date(this.form.returnDate).getTime()
 				let borrowDate = new Date(this.form.borrowDate).getTime()
 				let borrowDate = new Date(this.form.borrowDate).getTime()
-				borrowAsset(borrowDate,returnDate,data).then(res=>{
-					uni.showToast({
-						icon:"none",
-						title:"借用成功!"
+				try{
+					borrowAsset(borrowDate,returnDate,data).then(res=>{
+						uni.hideLoading()
+						// uni.showToast({
+						// 	icon:"none",
+						// 	title:"借用成功!"
+						// })
+						// uni.$u.toast('借用成功!')
+						this.initAssets(res.assetBarCode,1,"正在借用中")
 					})
 					})
-					this.initAssets(res.assetBarCode)
-				})
+				}catch(err){
+					uni.hideLoading()
+				}
+				
 			},
 			},
 			toReturnAsset(){
 			toReturnAsset(){
 				// uni.showLoading({
 				// uni.showLoading({
@@ -328,9 +355,10 @@
 					if(res.data.code===200 && res.data.msg==="归还成功"){
 					if(res.data.code===200 && res.data.msg==="归还成功"){
 						uni.showToast({
 						uni.showToast({
 							icon:"none",
 							icon:"none",
-							title:"归还成功!"
+							title:"归还成功!",
+							mask:true
 						})
 						})
-						this.initAssets(this.assetObj.barCode)
+						this.initAssets(this.assetObj.barCode,2,"正在归还中")
 					}
 					}
 				})
 				})
 			}
 			}

+ 2 - 1
pages/fault/fault-list/fault-list.vue

@@ -18,8 +18,9 @@
 		<u-empty
 		<u-empty
 			:show="dataList.length===0?true:false"
 			:show="dataList.length===0?true:false"
 			mode="list"
 			mode="list"
-			icon="http://cdn.uviewui.com/uview/empty/list.png"
+			:icon="require('@/static/images/list.png')"
 		>
 		>
+		<!-- http://cdn.uviewui.com/uview/empty/list.png -->
 		</u-empty>
 		</u-empty>
 		<view v-show="dataList.length===0?false:true">
 		<view v-show="dataList.length===0?false:true">
 			<u-cell-group :border="true">
 			<u-cell-group :border="true">

+ 30 - 19
pages/fault/fault-report/fault-report.vue

@@ -62,7 +62,12 @@
 			};
 			};
 		},
 		},
 		methods:{
 		methods:{
-			initAssets(data){
+			initAssets(data,str){
+				uni.showLoading({
+					title:str,
+					mask:true,
+					icon:'none'
+				})
 				searchAsset({barCode: data}).then(res=>{
 				searchAsset({barCode: data}).then(res=>{
 					if(res.barCode===null){
 					if(res.barCode===null){
 						this.model1.deviceName = ""
 						this.model1.deviceName = ""
@@ -82,39 +87,45 @@
 						this.model1.deviceName = res.name
 						this.model1.deviceName = res.name
 						this.model1.deviceNumber = res.barCode
 						this.model1.deviceNumber = res.barCode
 					}
 					}
-					
+					uni.hideLoading()
 				})
 				})
 			},
 			},
 			toReportFault(){
 			toReportFault(){
-				// uni.showLoading({
-				// 	title: "正在上报中",
-				// 	mask: true,
-				// });
+				uni.showLoading({
+					title: "正在上报中",
+					mask: true,
+					icon:'none'
+				});
 				let data = {
 				let data = {
 					"assetBarCode": this.model1.deviceNumber,
 					"assetBarCode": this.model1.deviceNumber,
 					"faultPhenomenon": this.fault,
 					"faultPhenomenon": this.fault,
 					"tel": cache.session.getJSON('phone')
 					"tel": cache.session.getJSON('phone')
 				}
 				}
 				reportFault(data).then(res=>{
 				reportFault(data).then(res=>{
-					uni.showModal({
-						title: '系统提示',
-						content: '故障上报成功,是否返回上一页',
-						success: function (res) {
-							if (res.confirm) {
-								uni.navigateBack({
-									delta:1
-								})
-							} else if (res.cancel) {
-								return;
+					uni.hideLoading()
+					if(res.faultPhenomenon!==""){
+						uni.showModal({
+							title: '系统提示',
+							content: '故障上报成功,是否返回上一页',
+							showCancel:false,
+							success: function (resp) {
+								if (resp.confirm) {
+									uni.navigateBack({
+										delta:1
+									})
+								} else if (resp.cancel) {
+									return;
+								}
 							}
 							}
-						}
-					});
+						});
+					}
+					
 				})
 				})
 			}
 			}
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
 			this.id = option.id
 			this.id = option.id
-			this.initAssets(option.id)
+			this.initAssets(option.id,'正在加载中')
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 5 - 4
pages/home/home.vue

@@ -79,7 +79,11 @@
 			},
 			},
 			initInfo(){
 			initInfo(){
 				const that = this
 				const that = this
-				uni.showLoading()
+				uni.showLoading({
+					title:"正在加载中",
+					icon:'none',
+					mask:true
+				})
 				try{
 				try{
 					getNewInform(4).then(res=>{
 					getNewInform(4).then(res=>{
 						if(res instanceof Array){
 						if(res instanceof Array){
@@ -171,10 +175,7 @@
 	}
 	}
 }
 }
 .rule-area{
 .rule-area{
-	// margin-bottom: 20rpx ;
 	flex-shrink: 0;
 	flex-shrink: 0;
-	// height: 270rpx;
-	// border: 2rpx solid #000;
 	.notice-li{
 	.notice-li{
 		display: flex;
 		display: flex;
 		flex-direction: row;
 		flex-direction: row;

+ 5 - 1
pages/login/login.vue

@@ -52,7 +52,11 @@
 				this.pwdType = "text"
 				this.pwdType = "text"
 			},
 			},
 			toLogin(){
 			toLogin(){
-				uni.showLoading()
+				uni.showLoading({
+					title:"正在登录中",
+					icon:'none',
+					mask:true
+				})
 				try{
 				try{
 					login(this.form.account,this.form.password).then(res=>{
 					login(this.form.account,this.form.password).then(res=>{
 						setToken(res.data.token)
 						setToken(res.data.token)

+ 18 - 12
pages/search/search.vue

@@ -18,7 +18,7 @@
 		<u-empty
 		<u-empty
 			:show="emptyShow"
 			:show="emptyShow"
 			mode="search"
 			mode="search"
-			icon="http://cdn.uviewui.com/uview/empty/search.png"
+			:icon="require('@/static/images/search.png')"
 		>
 		>
 		</u-empty>
 		</u-empty>
 		<view v-show="!emptyShow">
 		<view v-show="!emptyShow">
@@ -61,18 +61,24 @@
 		},
 		},
 		methods:{
 		methods:{
 			search(val){
 			search(val){
-				// uni.showLoading({
-				// 	title: "加载中",
-				// 	mask: true,
-				// });
-				searchAsset({numberOrName: val}).then(res=>{
-					if(res.length===0){
-						this.emptyShow = true
-					}else{
-						this.emptyShow = false
-						this.dataList = res
-					}
+				uni.showLoading({
+					title: "正在加载中",
+					mask: true
 				})
 				})
+				try{
+					searchAsset({numberOrName: val}).then(res=>{
+						if(res.length===0){
+							this.emptyShow = true
+						}else{
+							this.emptyShow = false
+							this.dataList = res
+						}
+						uni.hideLoading()
+					})
+				}catch(err){
+					uni.hideLoading()
+				}
+				
 			},
 			},
 			toBorrow(val){
 			toBorrow(val){
 				uni.navigateTo({
 				uni.navigateTo({

BIN
static/images/list.png


BIN
static/images/permission.png


BIN
static/images/search.png


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/borrow/borrow.js.map


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/login/login.js.map


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/search/search.js.map


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/common/vendor.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/borrow/borrow.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/home/home.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/login/login.js


+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/logo/index.js

@@ -1,2 +1,2 @@
-(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/logo/index"],{176:function(n,e,t){"use strict";(function(n,e){var r=t(4);t(26);r(t(25));var u=r(t(177));n.__webpack_require_UNI_MP_PLUGIN__=t,e(u.default)}).call(this,t(1)["default"],t(2)["createPage"])},177:function(n,e,t){"use strict";t.r(e);var r=t(178),u=t(180);for(var o in u)["default"].indexOf(o)<0&&function(n){t.d(e,n,(function(){return u[n]}))}(o);t(182);var c,i=t(37),a=Object(i["default"])(u["default"],r["render"],r["staticRenderFns"],!1,null,"c7c34cb2",null,!1,r["components"],c);a.options.__file="pages/logo/index.vue",e["default"]=a.exports},178:function(n,e,t){"use strict";t.r(e);var r=t(179);t.d(e,"render",(function(){return r["render"]})),t.d(e,"staticRenderFns",(function(){return r["staticRenderFns"]})),t.d(e,"recyclableRender",(function(){return r["recyclableRender"]})),t.d(e,"components",(function(){return r["components"]}))},179:function(n,e,t){"use strict";var r;t.r(e),t.d(e,"render",(function(){return u})),t.d(e,"staticRenderFns",(function(){return c})),t.d(e,"recyclableRender",(function(){return o})),t.d(e,"components",(function(){return r}));var u=function(){var n=this,e=n.$createElement;n._self._c},o=!1,c=[];u._withStripped=!0},180:function(n,e,t){"use strict";t.r(e);var r=t(181),u=t.n(r);for(var o in r)["default"].indexOf(o)<0&&function(n){t.d(e,n,(function(){return r[n]}))}(o);e["default"]=u.a},181:function(n,e,t){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t={data:function(){return{title:"Hello"}},onLoad:function(){},methods:{toLogin:function(){n.redirectTo({url:"/pages/login/login"})}}};e.default=t}).call(this,t(2)["default"])},182:function(n,e,t){"use strict";t.r(e);var r=t(183),u=t.n(r);for(var o in r)["default"].indexOf(o)<0&&function(n){t.d(e,n,(function(){return r[n]}))}(o);e["default"]=u.a},183:function(n,e,t){}},[[176,"common/runtime","common/vendor"]]]);
+(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/logo/index"],{174:function(n,e,t){"use strict";(function(n,e){var r=t(4);t(26);r(t(25));var u=r(t(175));n.__webpack_require_UNI_MP_PLUGIN__=t,e(u.default)}).call(this,t(1)["default"],t(2)["createPage"])},175:function(n,e,t){"use strict";t.r(e);var r=t(176),u=t(178);for(var o in u)["default"].indexOf(o)<0&&function(n){t.d(e,n,(function(){return u[n]}))}(o);t(180);var c,i=t(37),a=Object(i["default"])(u["default"],r["render"],r["staticRenderFns"],!1,null,"c7c34cb2",null,!1,r["components"],c);a.options.__file="pages/logo/index.vue",e["default"]=a.exports},176:function(n,e,t){"use strict";t.r(e);var r=t(177);t.d(e,"render",(function(){return r["render"]})),t.d(e,"staticRenderFns",(function(){return r["staticRenderFns"]})),t.d(e,"recyclableRender",(function(){return r["recyclableRender"]})),t.d(e,"components",(function(){return r["components"]}))},177:function(n,e,t){"use strict";var r;t.r(e),t.d(e,"render",(function(){return u})),t.d(e,"staticRenderFns",(function(){return c})),t.d(e,"recyclableRender",(function(){return o})),t.d(e,"components",(function(){return r}));var u=function(){var n=this,e=n.$createElement;n._self._c},o=!1,c=[];u._withStripped=!0},178:function(n,e,t){"use strict";t.r(e);var r=t(179),u=t.n(r);for(var o in r)["default"].indexOf(o)<0&&function(n){t.d(e,n,(function(){return r[n]}))}(o);e["default"]=u.a},179:function(n,e,t){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t={data:function(){return{title:"Hello"}},onLoad:function(){},methods:{toLogin:function(){n.redirectTo({url:"/pages/login/login"})}}};e.default=t}).call(this,t(2)["default"])},180:function(n,e,t){"use strict";t.r(e);var r=t(181),u=t.n(r);for(var o in r)["default"].indexOf(o)<0&&function(n){t.d(e,n,(function(){return r[n]}))}(o);e["default"]=u.a},181:function(n,e,t){}},[[174,"common/runtime","common/vendor"]]]);
 //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/logo/index.js.map
 //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/logo/index.js.map

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/menus/borrow-record/borrow-record.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/menus/menu/menu.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/menus/mine/mine.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/return/return.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/search/search.js


+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/search/search.wxml

@@ -1 +1 @@
-<view class="home data-v-4cedc0c6"><view class="search-area data-v-4cedc0c6" style="margin-bottom:20rpx;"><u-search vue-id="50cad900-1" placeholder="搜索设备" shape="square" clearabled="{{true}}" show-action="{{true}}" action-text="搜索" animation="{{true}}" search-icon-color="#000" color="#000" placeholder-color="#5c5b5b" value="{{keyword}}" data-event-opts="{{[['^search',[['search',['$0'],['keyword']]]],['^custom',[['search',['$0'],['keyword']]]],['^input',[['__set_model',['','keyword','$event',[]]]]]]}}" bind:search="__e" bind:custom="__e" bind:input="__e" class="data-v-4cedc0c6" bind:__l="__l"></u-search></view><u-empty vue-id="50cad900-2" show="{{emptyShow}}" mode="search" icon="http://cdn.uviewui.com/uview/empty/search.png" class="data-v-4cedc0c6" bind:__l="__l"></u-empty><view hidden="{{!(!emptyShow)}}" class="data-v-4cedc0c6"><u-cell-group vue-id="50cad900-3" border="{{true}}" class="data-v-4cedc0c6" bind:__l="__l" vue-slots="{{['default']}}"><u-cell vue-id="{{('50cad900-4')+','+('50cad900-3')}}" title="设备" value="状态" title-style="{{$root.a0}}" value-style="{{$root.a1}}" class="data-v-4cedc0c6" bind:__l="__l"></u-cell><block wx:for="{{dataList}}" wx:for-item="item" wx:for-index="__i0__" wx:key="barCode"><u-cell vue-id="{{('50cad900-5-'+__i0__)+','+('50cad900-3')}}" title="{{item.name}}" value="{{item.borrowStatus}}" label="{{item.barCode}}" data-event-opts="{{[['^click',[['toBorrow',['$0'],[[['dataList','barCode',item.barCode,'barCode']]]]]]]}}" bind:click="__e" class="data-v-4cedc0c6" bind:__l="__l"></u-cell></block></u-cell-group></view></view>
+<view class="home data-v-4cedc0c6"><view class="search-area data-v-4cedc0c6" style="margin-bottom:20rpx;"><u-search vue-id="50cad900-1" placeholder="搜索设备" shape="square" clearabled="{{true}}" show-action="{{true}}" action-text="搜索" animation="{{true}}" search-icon-color="#000" color="#000" placeholder-color="#5c5b5b" value="{{keyword}}" data-event-opts="{{[['^search',[['search',['$0'],['keyword']]]],['^custom',[['search',['$0'],['keyword']]]],['^input',[['__set_model',['','keyword','$event',[]]]]]]}}" bind:search="__e" bind:custom="__e" bind:input="__e" class="data-v-4cedc0c6" bind:__l="__l"></u-search></view><u-empty vue-id="50cad900-2" show="{{emptyShow}}" mode="search" icon="{{$root.m0}}" class="data-v-4cedc0c6" bind:__l="__l"></u-empty><view hidden="{{!(!emptyShow)}}" class="data-v-4cedc0c6"><u-cell-group vue-id="50cad900-3" border="{{true}}" class="data-v-4cedc0c6" bind:__l="__l" vue-slots="{{['default']}}"><u-cell vue-id="{{('50cad900-4')+','+('50cad900-3')}}" title="设备" value="状态" title-style="{{$root.a0}}" value-style="{{$root.a1}}" class="data-v-4cedc0c6" bind:__l="__l"></u-cell><block wx:for="{{dataList}}" wx:for-item="item" wx:for-index="__i0__" wx:key="barCode"><u-cell vue-id="{{('50cad900-5-'+__i0__)+','+('50cad900-3')}}" title="{{item.name}}" value="{{item.borrowStatus}}" label="{{item.barCode}}" data-event-opts="{{[['^click',[['toBorrow',['$0'],[[['dataList','barCode',item.barCode,'barCode']]]]]]]}}" bind:click="__e" class="data-v-4cedc0c6" bind:__l="__l"></u-cell></block></u-cell-group></view></view>

Some files were not shown because too many files changed in this diff