zhengkaixin 1 년 전
부모
커밋
477b170dc4

+ 20 - 0
apis/pagejs/index.js

@@ -124,3 +124,23 @@ export function outDeviceList(data) {
 		url: '/mobile/device/outDeviceList'
 	})
 } 
+
+
+export function outDeviceByUser(data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/mobile/device/outDeviceByUser'
+	})
+} 
+
+
+export function outDeviceTitleByUser(data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/mobile/device/outDeviceTitleByUser'
+	})
+} 

+ 139 - 36
components/equipmentRetrieval.vue

@@ -60,7 +60,7 @@
 									{{item.model}}
 								</view>
 							</view>
-							<view class="inventory">
+							<view class="inventory" v-if="!item.code">
 								<view class="infos-title">
 									库存:
 								</view>
@@ -68,6 +68,12 @@
 									{{item.count}}
 								</view>
 							</view>
+							<view class="inventory" v-esle >
+								
+								<view class="value">
+									{{item.code}}
+								</view>
+							</view>
 							<view class="inventory"  v-if="queryContentBl">
 								<view class="infos-title">
 									分类:
@@ -79,7 +85,7 @@
 						</view>
 						<view class="option" v-if="iscomponents==1" >
 							
-								<u-button v-if="deterItem(item)"  @click="ckItem(item)"
+								<u-button v-if="deterItem(item)"   @click="ckItem(item)"
 								 style="height: 48rpx;" :custom-style="customStyle"
 								 type="error" ><u-icon name="trash-fill"></u-icon>删除</u-button>
 								
@@ -116,10 +122,17 @@
 			iscomponents:{
 				default: ""
 			},
+			isreturn:{
+				default: ""
+			},
 			list:{
 			
 				 default: () => [],
-			}
+			},
+			scanList:{
+			
+				 default: () => [],
+			},
 		},
 		data() {
 			return {
@@ -201,7 +214,7 @@
 				})
 				API.deviceTypeList({}).then((res) => {
 					
-					this.menuList = res.data.deviceTypeList.map(item=>{
+					var menuList = res.data.deviceTypeList.map(item=>{
 						return {
 							typeId:item.id,
 							name:item.name,
@@ -212,8 +225,34 @@
 							recordsTotal:0
 						}
 					});
+					var sz=[]
+					if(this.isreturn){
+						sz=[
+							{
+								typeId:"-$jp%-0",
+								name:"未归还设备",
+								
+								list:[],
+								pageIndex:1,
+								pageSize:10,
+								recordsTotal:0
+							},
+							// {
+							// 	typeId:"-$jp%-1",
+							// 	name:"借出历史",
+								
+							// 	list:[],
+							// 	pageIndex:1,
+							// 	pageSize:10,
+							// 	recordsTotal:0
+							// },
+						]
+					}
 					
-					
+					this.menuList = [
+						...sz,
+						...menuList
+					] 
 					
 					uni.hideLoading();
 					if(this.menuList.length>0){
@@ -236,16 +275,31 @@
 				}
 			},
 			viewInfo(item){
+				if(item.code){
+					uni.navigateTo({
+						url:"/pages/otherFunctions/equipmentRetrieval/equipmentInfo?id="+item.id
+					})
+				}else{
+					uni.navigateTo({
+						url:"/pages/otherFunctions/equipmentRetrieval/equipmentDetail?name="+item.title+"&model="+item.model
+					})
+				}
 				
-				uni.navigateTo({
-					url:"/pages/otherFunctions/equipmentRetrieval/equipmentDetail?name="+item.title+"&model="+item.model
-				})
 			},
 			deterItem(item){
-				var c=this.list.find(it=>{
-					
-					return it.obj.id==item.id
-				})
+				var c=""
+				if(item.code){
+					c=this.scanList.find(it=>{
+						
+						return it.id==item.id
+					})
+				}else{
+					c=this.list.find(it=>{
+						
+						return it.obj.id==item.id
+					})
+				}
+				
 				if(c){
 					return true
 				}else{
@@ -253,6 +307,7 @@
 				}
 			},
 			ckItem(item){
+				console.log(this.scanList)
 				this.$emit('ckItem',item)
 				
 			},
@@ -266,6 +321,9 @@
 				this.getList();
 			},
 			getList(){
+				
+				
+				
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
@@ -285,35 +343,80 @@
 					  //this.queryContentBl=false
 				 }
 				 delete data.list;
-				 
-				API.deviceList(data).then((res) => {
-					if(data.pageIndex==1){
-						list = res.data.data;
-					}else{
-						list = [
-							...list,
-							...res.data.data
-						];
-					}
+				if(["-$jp%-0","-$jp%-1"].indexOf(data.typeId)!=-1){
 					if(this.queryContent){
-						this.queryContentBl=true
-					
+						
+										
 					}else{
+										 
 						this.queryContentBl=false
-						this.menuList[this.checkindex].list=list
-								
-						this.menuList[this.checkindex].recordsTotal = res.data.recordsTotal;
 					}
-					this.form.recordsTotal = res.data.recordsTotal;
-					this.indexList=list;
-					console.log(this.form.recordsTotal ,list.length)
-					uni.hideLoading();
-					
-				}).catch(error => {
-					uni.showToast({
-						title: error
+					if(data.typeId=="-$jp%-0"){
+						API.outDeviceByUser(data).then((res) => {
+							if(data.pageIndex==1){
+								list = res.data.outDeviceList.data;
+							}else{
+								list = [
+									...list,
+									...res.data.outDeviceList.data
+								];
+							}
+							this.menuList[this.checkindex].list=list
+										
+							this.menuList[this.checkindex].recordsTotal = res.data.outDeviceList.recordsTotal;
+							
+							this.form.recordsTotal = res.data.outDeviceList.recordsTotal;
+							this.indexList=list;
+							
+							uni.hideLoading();
+							
+						}).catch(error => {
+							uni.showToast({
+								title: error
+							})
+						})
+						
+					}
+					if(data.typeId=="-$jp%-1"){
+						//废弃
+					}	
+						
+										 
+										 
+				}else{
+					if(this.isreturn){
+						data.queryAll=1
+					}
+					API.deviceList(data).then((res) => {
+						if(data.pageIndex==1){
+							list = res.data.data;
+						}else{
+							list = [
+								...list,
+								...res.data.data
+							];
+						}
+						if(this.queryContent){
+							this.queryContentBl=true
+						
+						}else{
+							this.queryContentBl=false
+							this.menuList[this.checkindex].list=list
+									
+							this.menuList[this.checkindex].recordsTotal = res.data.recordsTotal;
+						}
+						this.form.recordsTotal = res.data.recordsTotal;
+						this.indexList=list;
+						//console.log(this.form.recordsTotal ,list.length)
+						uni.hideLoading();
+						
+					}).catch(error => {
+						uni.showToast({
+							title: error
+						})
 					})
-				})
+				} 
+				
 			},
 			datainit(){
 				// var data = this.menuList[this.checkindex];

+ 2 - 1
pages/projectDepartment/exportApplication/deliveryFrom.vue

@@ -256,6 +256,7 @@
 				approve2:"",
 				queryContent:'',
 				list:[],
+				
 				show2:false,//审批人 步骤1
 				show3:false,//审批人 步骤1
 				show4:false,//审批人 步骤1
@@ -638,7 +639,7 @@
 		overflow: hidden;
 	
 		.search-box {
-			display: flex;flex-wrap: wrap;
+			display: flex;
 			border-radius: 8px;
 			overflow: hidden;
 		}

+ 174 - 28
pages/projectDepartment/exportReturn/deliveryFrom.vue

@@ -15,17 +15,35 @@
 						<view class="title">
 							所属项目<span style="color: red;">*</span>
 						</view>
-						<view class="amount" v-if="approveList.length" >
-							<span  @click="show4=true" 
-							 style="float: right; color: #45BA45; font-size: 12px;font-weight: normal;">
-											<u-icon name="file-text"></u-icon>引用</span>
+						<view  class="amountView" >
+							<view class="amount" v-if="approveList.length" >
+								<span  @click="show4=true" 
+								 style="float: right; color: #45BA45; font-size: 12px;font-weight: normal;">
+												<u-icon name="file-text"></u-icon>引用</span>
+							</view>
+							<view class="amount" >
+								<u-input style="border-bottom: 1px solid;"
+								 v-model="form.projectName" placeholder="请输入所属项目" type="text" />
+								 
+							</view>
+						</view>
+					</view>
+					<view class="list-head" v-if="false">
+						<view class="title">
+							无二维码设备
 						</view>
-						<view class="amount" >
-							<u-input style="border-bottom: 1px solid;"
-							 v-model="form.projectName" placeholder="请输入所属项目" type="text" />
-							 
+						<view  class="amountView" >
+							<view class="amount"  >
+								<span  @click="show5=true" 
+								 style="float: right; color: #45BA45; font-size: 12px;font-weight: normal;">
+												<u-icon name="file-text"></u-icon>添加设备</span>
+							</view>
+							<view class="amount" >
+								二维码损坏,或者无二维码
+							</view>
 						</view>
 						
+						
 					</view>
 					
 				</view>
@@ -149,19 +167,47 @@
 
 				</view>
 			</view>
-			<u-divider   :isnone="scanList.length==0"
 			
-			nonetext="点击'扫码'进行归还"  nonetop="110" border-color="#CFD2D5">已经到底了</u-divider>
-		
 		</view>
 		
 		<u-divider   :isnone="scanList.length==0" v-show="scanList.length==0"
 		
-		nonetext="点击'扫码'进行归还"  nonetop="110" border-color="#CFD2D5">已经到底了</u-divider>
+		nonetext="点击'扫码'进行归还"  nonetop="150" border-color="#CFD2D5">已经到底了</u-divider>
 				
 		<u-select v-model="show4"  label-name="projectName" value-name="id"
 		:list="approveList"   @confirm="confirm4" ></u-select>
-			 
+		
+		<u-popup  v-model="show5"  mode="bottom"
+		border-radius="14"
+		:closeable="true"  >
+					<view class="showpopup">添加设备</view>
+						
+						<!-- 搜索 -->
+						<view class="search"  >
+							
+							<view class="search-box">
+								<u-search placeholder="搜索设备名称或型号" 
+								  @custom="ckQueryContent"
+								   @search="ckQueryContent"
+								 v-model="queryContent" :show-action="false">
+						
+								</u-search>
+								<view class="search-btn"  @click="ckQueryContent"  >
+									<view class="text">
+										搜索
+									</view>
+								</view>
+							</view>
+						</view>
+						<scroll-view scroll-y="true" style="height: 800rpx;" @scrolltolower="refscrolltolower()">
+							
+						
+						<equipmentRetrieval   @ckItem="ckItem" :list="list" :scanList="scanList"
+						
+						 ref="equipmentRetrievalRef" :iscomponents="1" :isreturn="1" ></equipmentRetrieval>
+						</scroll-view>
+				</u-popup>
+				 
 		<!-- 确认出库 -->
 		<view class="bottom"  >
 			
@@ -173,6 +219,7 @@
 
 <script>
 	import * as API from '@/apis/pagejs/projectDepartment.js'
+	import equipmentRetrieval from "@/components/equipmentRetrieval"
 	
 	export default {
 		data() {
@@ -198,9 +245,13 @@
 					recordId:"",
 					deviceIds:"",
 				},
+				list:[],
+				list2:[],
+				queryContent:'',
 				scanList:[],
 				approveList:[],
 				show4:false,
+				show5:false,
 				radiolist: [{
 						name: '正常',
 						value: "0",
@@ -218,7 +269,36 @@
 		onReady(){
 			this.getApproveList();
 		},
+		components:{
+			equipmentRetrieval
+		},
 		methods: {
+			ckItem(item){
+				if(item.code){
+					
+					var c = this.scanList.findIndex(op => {
+						return op.code == item.code
+					})
+					if (c==-1) {
+						this.getscan(item.code,true)
+						
+					}else{
+						this.delOutListMethod(c)
+					}
+					
+					
+					
+				}else{
+					this.list2.push(item)
+				}
+			},
+			refscrolltolower(){
+				this.$refs.equipmentRetrievalRef.myLoadmoreonReachBottom()
+			},
+			ckQueryContent(){
+				this.$refs.equipmentRetrievalRef.queryContent=this.queryContent
+				this.$refs.equipmentRetrievalRef.getList()
+			},
 			confirm4(e) {
 				this.form.projectName=e[0].label;
 			},
@@ -335,8 +415,13 @@
 					})
 				})
 			},
-			getscan(val) {
-				this.showpopup=true;
+			getscan(val,k) {
+				if(k){
+					
+				}else{
+					this.showpopup=true;
+				}
+				
 				var c = this.scanList.find(item => {
 					return item.code == val
 				})
@@ -454,6 +539,61 @@
 </script>
 
 <style scoped lang="scss">
+	.showpopup{
+		font-size: 36rpx;
+		text-align: center;
+		margin: 32rpx;
+	}
+	// 搜索
+	.search {
+		padding: 12rpx 24rpx;
+		display: flex;flex-wrap: wrap;
+		border-radius: 8px;
+		overflow: hidden;
+	
+		.search-box {
+			display: flex;
+			border-radius: 8px;
+			overflow: hidden;
+		}
+		
+		/deep/.u-search {
+			width: 630rpx;
+			margin: auto !important;
+			position: relative;
+			flex: 0;
+			margin: 0 !important;
+			height: 64rpx !important;
+		}
+	
+		/deep/.u-content {
+			width: 430px;
+			border-radius: 0px !important;
+			height: 64rpx !important;
+		}
+	
+		/deep/.u-icon--right {
+			margin-right: 16rpx;
+		}
+	
+		.search-btn {
+			width: 100rpx;
+			height: 64rpx;
+			background-color: #f2f2f2;
+	
+			.text {
+				height: 40rpx;
+				margin: 12rpx 0;
+				border-left: 1px solid #999999;
+				font-family: Microsoft Yahei;
+				text-align: center;
+				color: rgba(16, 98, 213, 1);
+				font-size: 28rpx;
+			}
+		}
+	}
+	
+	
 	.scantitle{
 		text-align: center;
 		font-size: 44rpx;
@@ -541,7 +681,7 @@
 		}
 	}
 	.container{
-		margin-top: 80px;
+		margin-top: 140px;
 		
 	}
 
@@ -581,24 +721,30 @@
 			display: flex;flex-wrap: wrap;
 			justify-content: space-between;
 			align-items: center;
-
+			
 			.title {
+				padding: 8rpx 0;
 				color: #333333;
 				font-size: 32rpx
 			}
-
-			.amount {
-				color: #777777;
-				font-size: 24rpx;
-
-				text {
-					color: #3385FF;
-				}
-
-				/deep/.u-icon--right {
-					margin-left: 8rpx;
+			.amountView{
+				display: flex;flex-wrap: wrap;
+				justify-content: space-between;
+				align-items: center;
+				.amount {
+					color: #777777;
+					font-size: 24rpx;
+				
+					text {
+						color: #3385FF;
+					}
+				
+					/deep/.u-icon--right {
+						margin-left: 8rpx;
+					}
 				}
 			}
+			
 		}
 
 		// 清单信息