zhengkaixin 1 anno fa
parent
commit
ca2a74686d

+ 53 - 25
components/equipmentRetrieval.vue

@@ -130,6 +130,12 @@
 	
 	export default {
 		props:{
+			departmentId:{
+				default: ""
+			},
+			queryStatus:{
+				default: 0
+			},
 			iscomponents:{
 				default: ""
 			},
@@ -185,8 +191,45 @@
 			}
 		},
 		mounted() {
-			
-			this.getDeviceTypeList();
+			if(this.isreturn){
+				if(this.isreturn){
+					var 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,
+						
+					] 
+					
+					uni.hideLoading();
+					if(this.menuList.length>0){
+						this.getList()
+					}
+					
+					//this.getList()
+				}
+			}else{
+				this.getDeviceTypeList();
+			}
 		},
 		onReady() {
 			//this.getList()
@@ -197,6 +240,10 @@
 			
 		},
 		methods: {
+			init(){
+				this.menuList[this.checkindex].pageIndex=1
+				this.getList()
+			},
 			myLoadmoreonReachBottom(){
 			
 				var obj=this.menuList[this.checkindex]
@@ -237,28 +284,7 @@
 						}
 					});
 					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,
@@ -361,6 +387,8 @@
 						this.queryContentBl=false
 					}
 					if(data.typeId=="-$jp%-0"){
+						data.departmentId=this.departmentId;
+						data.queryStatus=!this.queryStatus?1:0
 						API.outDeviceByUser(data).then((res) => {
 							if(data.pageIndex==1){
 								list = res.data.outDeviceList.data;
@@ -522,7 +550,7 @@
 	}
 	.calc10081{
 			//height: calc(95vh - 90px);
-			height:700rpx
+			height:800rpx
 	}
 	.calc10082{
 			height: calc(95vh - 90px);

+ 3 - 3
config/.env.dev.js

@@ -16,10 +16,10 @@ const UNI_APP = {
 	//openId:"123",// 项目部 - 审批1
 	//openId:"223",// 项目部 - 审批2
 	//openId:"323",// 项目部 - 审批3
-	openId:"oBA__5fiKEszHSigQGwZbLCVbg5A",//杨所
-	openId:"oBA__5X5N82jX6moeOFkbnRNjPog",//  sz
+	//openId:"oBA__5fiKEszHSigQGwZbLCVbg5A",//杨所
+	//openId:"oBA__5X5N82jX6moeOFkbnRNjPog",//  sz
 	//openId:"oK9Wr58zNwDernF0TL6o3mdUxk2A",
-	//openId:"oK9Wr5xRUoP9EygZqBec0xkJMVTs",
+	//openId:"oBA__5f5JQpynpvw2sNxmwWNbcOU",//csm
 	//openId:"oK9Wr55J1J1eL6BqI2tW749NTxNU",//zq
 	//小鹏管家appid
 	//VUE_APP_WXAPPID:"wx7e70eb62a8459869",

+ 1 - 3
pages/otherFunctions/components/u-collapse-item.vue

@@ -14,9 +14,7 @@
 			</block>
 			<slot v-else name="title-all" />
 		</view>
-		<view class="u-collapse-body" :style="[{
-				height: isShow ? height + 'px' : '0'
-			}]">
+		<view class="u-collapse-body"  v-show="isShow">
 			<view class="u-collapse-content" :id="elId" :style="[bodyStyle]">
 				<slot></slot>
 			</view>

+ 11 - 8
pages/projectDepartment/exportApplication/deliveryDetails.vue

@@ -23,6 +23,16 @@
 		</view>
 		<!-- 出库单详情 -->
 		<view class="details">
+			
+			<view class="item">
+				<view class="name">
+					所属项目部
+				</view>
+				<view class="value">
+					{{info.departmentName}}
+				</view>
+			</view>
+			
 			<view class="item">
 				<view class="name">
 					所属项目
@@ -48,14 +58,7 @@
 				</view>
 			</view>
 			
-			<view class="item">
-				<view class="name">
-					所属项目部
-				</view>
-				<view class="value">
-					{{info.departmentName}}
-				</view>
-			</view>
+			
 			<view class="item">
 				<view class="name">
 					申请时间

+ 12 - 9
pages/projectDepartment/exportApplication/deliveryFrom.vue

@@ -6,12 +6,23 @@
 	
 		<!-- 出库单详情 -->
 		<view class="details">
+			
 			<p  class="itemp">项目信息
 			 
 			 <span  @click="show4=true" v-if="approveList.length"
 			  style="float: right; color: #45BA45; font-size: 12px;font-weight: normal;">
+			  
 				<u-icon name="file-text"></u-icon>引用历史项目</span></p>
 			
+			<view class="item" >
+				<view class="name">
+					所属项目部<span style="color: red;">*</span>
+				</view>
+				<view class="value">
+					
+					<u-input v-model="xmbId" @click="show3=true,showText='xmbId'"  @clear="showText='xmbId',change('')"   placeholder="请选择所属项目部" 	 type="select" />
+				</view>
+			</view>
 			<view class="item">
 				<view class="name">
 					所属项目<span style="color: red;">*</span>
@@ -40,15 +51,7 @@
 					<u-input v-model="endTime" @click="show=true,showText='endTime'"  @clear="showText='endTime',change('')"   placeholder="请输入使用周期" 	 type="select" />
 				</view>
 			</view>
-			<view class="item" >
-				<view class="name">
-					所属项目部<span style="color: red;">*</span>
-				</view>
-				<view class="value">
-					
-					<u-input v-model="xmbId" @click="show3=true,showText='xmbId'"  @clear="showText='xmbId',change('')"   placeholder="请选择所属项目部" 	 type="select" />
-				</view>
-			</view>
+			
 			<p  class="itemp">选择审批人</p>
 			<view class="item" v-for="(item,i) in approveProcessList"  :key="i" >
 				<view class="name">

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

@@ -3,44 +3,49 @@
 		<u-navbar title="申请归还">
 			<view class="details" slot="bottom">
 				<view class="list">
-					<view class="list-head" style="margin-bottom: 3px;">
+					<!-- <view class="list-head" style="margin-bottom: 3px;">
 						<view class="title">
 							出库设备清单
 						</view>
-						<view class="amount"  @click="gotoscan('')">
-							<u-icon name="scan" color="#0051ff" ></u-icon>扫码识别
-						</view>
-					</view>
+						
+					</view> -->
 					<view class="list-head">
 						<view class="title">
-							所属项目<span style="color: red;">*</span>
+							所属项目<span style="color: red;">*</span>
 						</view>
 						<view  class="amountView" >
-							<view class="amount" v-if="approveList.length" >
+							<!-- <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> -->
 							<view class="amount" >
-								<u-input style="border-bottom: 1px solid;"
+								<!-- <u-input style="border-bottom: 1px solid;"
 								 v-model="form.projectName" placeholder="请输入所属项目" type="text" />
+								 -->
+								 
+								 <u-input v-model="xmbId" @click="show3=true,showText='xmbId'"  @clear="showText='xmbId',change('')"   placeholder="请选择所属项目部" 	 type="select" />
 								 
 							</view>
 						</view>
 					</view>
 					<view class="list-head" >
 						<view class="title">
-							无二维码设备
+							选择设备
 						</view>
-						<view  class="amountView" >
+						<view  class="amountView" style="margin-top: 5px;" >
 							<view class="amount"  >
-								<span  @click="show5=true" 
+								<span  @click="show5Btn" 
 								 style="float: right; color: #45BA45; font-size: 12px;font-weight: normal;">
 												<u-icon name="file-text"></u-icon>添加设备</span>
 							</view>
-							<view class="amount" >
-								二维码损坏,或者无二维码
+							<view class="amount" style="margin: 0 20px;" >
+								或者
+							</view>
+							<view class="amount"  @click="gotoscan('')" style=" color: #0051ff;font-size: 12px;">
+								<u-icon name="scan" color="#0051ff" ></u-icon>扫码识别
 							</view>
+							
 						</view>
 						
 						
@@ -172,7 +177,7 @@
 		
 		<u-divider   :isnone="scanList.length==0" v-show="scanList.length==0"
 		
-		nonetext="点击'扫码'进行归还"  nonetop="150" 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>
@@ -181,7 +186,11 @@
 		border-radius="14"
 		:closeable="true"  >
 					<view class="showpopup">添加设备</view>
-						
+						<view class="search"   >
+							只查自己借出设备<u-switch v-model="queryStatus"
+							  :active-value="0" :inactive-value="1"
+							 @change="switchchange"></u-switch>
+						</view>
 						<!-- 搜索 -->
 						<view class="search"  v-if="false" >
 							
@@ -202,11 +211,14 @@
 						<view  @scrolltolower="refscrolltolower()">
 							
 						
-						<equipmentRetrieval   @ckItem="ckItem" :list="list" :scanList="scanList"
+						<equipmentRetrieval  :departmentId="form.xmbId"
+						  :queryStatus="queryStatus"
+						  @ckItem="ckItem" :list="list" :scanList="scanList"
 						
 						 ref="equipmentRetrievalRef" :iscomponents="1" :isreturn="1" ></equipmentRetrieval>
 						</view>
 				</u-popup>
+				 <u-select v-model="show3" :list="projectList"   @confirm="confirm" ></u-select>
 				 
 		<!-- 确认出库 -->
 		<view class="bottom"  >
@@ -238,20 +250,27 @@
 				address:"",
 				showpopup:false,
 				deviceposition:"back",
-				
+				queryStatus:true,
 				form:{
 					projectName:"",
 					addressId:"",
 					recordId:"",
 					deviceIds:"",
+						xmbId:"",
 				},
+					show3:false,//审批人 步骤1
 				list:[],
 				list2:[],
+					showText:"",
+				xmbId:"",
 				queryContent:'',
 				scanList:[],
 				approveList:[],
 				show4:false,
 				show5:false,
+				projectList:[
+					
+				],
 				radiolist: [{
 						name: '正常',
 						value: "0",
@@ -262,17 +281,72 @@
 						value: "1",
 						disabled: false
 					},
-				
+					
 				],
 			}
 		},
 		onReady(){
-			this.getApproveList();
+			//this.getApproveList();
+			this.createOutRecord();
 		},
 		components:{
 			equipmentRetrieval
 		},
 		methods: {
+			switchchange(e){
+				console.log(e)
+				
+				this.$refs.equipmentRetrievalRef.init()
+			},
+			show5Btn(){
+				if(this.form.xmbId){
+					this.show5=true
+				}else{
+					uni.showToast({
+						title:"请先选择所属项目部"
+					})
+				}
+				
+			},
+			confirm(e) {
+				if(e==''){
+					this.form[this.showText]='';
+					this[this.showText]=''
+				}else{
+					this.form[this.showText]=e[0].value;
+					this[this.showText]=e[0].label
+				}
+			},
+			createOutRecord(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.createOutRecord({
+					
+				}).then((res) => {
+					uni.hideLoading();
+					if(res.data.departmentList){
+						this.projectList=res.data.departmentList.map(item=>{
+							return {
+								value: item.id,
+								label: item.name
+							}
+						})
+						if(this.projectList.length==1){
+							this.form.xmbId=this.projectList[0].value;
+							this.xmbId=this.projectList[0].label
+						}
+					}
+					
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			ckItem(item){
 				if(item.code){
 					
@@ -344,14 +418,14 @@
 				}
 			},
 			gotoOut() {
-				if(!this.form.projectName){
+				// if(!this.form.projectName){
 					
-					uni.showToast({
-						title: "请输入项目名称",
-						icon: "none"
-					})
-					return
-				}
+				// 	uni.showToast({
+				// 		title: "请输入项目名称",
+				// 		icon: "none"
+				// 	})
+				// 	return
+				// }
 				if(this.scanList.length==0){
 					uni.showToast({
 						title: "请扫码添加出库设备",
@@ -681,7 +755,7 @@
 		}
 	}
 	.container{
-		margin-top: 140px;
+		margin-top: 80px;
 		
 	}