zhengkaixin il y a 2 ans
Parent
commit
19f88c4e1f

+ 72 - 38
apis/pagejs/projectDepartment.js

@@ -1,38 +1,72 @@
-import request from '@/apis/utils/request'
-
-//----出库
-export function outApplyList(data) {
-	var url='/mobile/out/outApplyList';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-export function outRecord(data) {
-	var url='/mobile/out/outRecord';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-
-export function outRecordDeviceById(data) {
-	var url='/mobile/out/outRecordDeviceById';
-	return request({
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
-export function saveOutRecord(data) {
-	var url='/mobile/out/saveOutRecord';
-	return request({
-	//	header:{'Content-Type':'application/json'},
-		
-		method: 'post',
-		data: data,
-		url: url
-	})
-}
+import request from '@/apis/utils/request'
+
+//----出库
+export function outApplyList(data) {
+	var url = '/mobile/out/outApplyList';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+export function outRecord(data) {
+	var url = '/mobile/out/outRecord';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function outRecordDeviceById(data) {
+	var url = '/mobile/out/outRecordDeviceById';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+export function saveOutRecord(data) {
+	var url = '/mobile/out/saveOutRecord';
+	return request({
+		//	header:{'Content-Type':'application/json'},
+
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function createOutRecord(data) {
+	var url = '/mobile/out/createOutRecord';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+export function outRecordDetail(data) {
+	var url = '/mobile/out/outRecordDetail';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export const recordStatus = (val) => {
+	var retu = ""
+	switch (val) {
+		case '0':
+			retu = '待审核'
+			break;
+		case '1':
+			retu = '待出库'
+			break;
+		case '2':
+			retu = '已出库'
+			break;
+	}
+
+	return retu
+}

+ 61 - 23
pages/index/equipmentRetrieval/equipmentRetrieval.vue

@@ -12,7 +12,7 @@
 				<u-search placeholder="搜索设备名称或型号" v-model="queryContent" :show-action="false">
 
 				</u-search>
-				<view class="search-btn" @click="form.pageIndex=1,getList" >
+				<view class="search-btn" @click="form.pageIndex=1,getList()" >
 					<view class="text">
 						搜索
 					</view>
@@ -21,8 +21,8 @@
 		</view>
 		<view class="main">
 			<!-- 分类 -->
-			<view class="classify">
-				<view class="item " v-for="(item,index) in menuList" @click="toggle(index)"
+			<view class="classify" v-if="!queryContentBl">
+				<view class="item " v-for="(item,index) in menuList" :key="index" @click="toggle(index)"
 					:class="{'checked':index ==checkindex }">
 					{{item.name}}<br/>
 				</view>
@@ -40,7 +40,9 @@
 						<view class="picture">
 							<img :src="item.imgUrl" alt="">
 						</view>
-						<view class="infos" >
+						<view class="infos" :class="{
+							infosQuery:queryContentBl
+						}" >
 							<view class="name">
 								{{item.title}}
 							</view>
@@ -60,7 +62,14 @@
 									{{item.count}}
 								</view>
 							</view>
-	
+							<view class="inventory"  v-if="queryContentBl">
+								<view class="infos-title">
+									分类:
+								</view>
+								<view class="value">
+									{{getMenuListName(item.typeId)}}
+								</view>
+							</view>
 						</view>
 						<view class="option" >
 								<u-button  v-if="iscomponents==1" @click="ckItem(item)"
@@ -124,12 +133,30 @@
 			//this.getList()
 		},
 		onReachBottom() {
-			var obj=this.list[this.current]
-			if (obj.list.length < obj.recordsTotal) {			
-				this.myLoadmore();
-			}
+			this.myLoadmoreonReachBottom()
+			
 		},
 		methods: {
+			myLoadmoreonReachBottom(){
+				var obj=this.menuList[this.checkindex]
+				if(this.queryContentBl){
+					obj=this.form;
+				}
+				console.log(obj)
+				if (this.indexList < obj.recordsTotal) {			
+					this.myLoadmore();
+				}
+			},
+			getMenuListName(id){
+				var obj =this.menuList.filter(item=>{
+					
+					return id==item.typeId;
+				})
+				if(obj.length){
+					return obj[0].name
+				}
+				
+			},
 			getDeviceTypeList(){
 				uni.showLoading({
 					title: "加载中",
@@ -142,8 +169,8 @@
 							typeId:item.id,
 							name:item.name,
 							list:[],
-							pageIndex:0,
-							pageSize:20,
+							pageIndex:1,
+							pageSize:10,
 							recordsTotal:0
 						}
 					});
@@ -172,7 +199,12 @@
 				
 			},
 			myLoadmore(){
-				this.menuList[this.checkindex].pageIndex += 1;
+				if(this.queryContentBl){
+					this.form.pageIndex += 1;
+				}else{
+					this.menuList[this.checkindex].pageIndex += 1;
+					
+				}
 				this.getList();
 			},
 			getList(){
@@ -185,10 +217,11 @@
 				 var data = this.menuList[this.checkindex];
 				
 				 if(this.queryContent){
-					 data.queryContent=this.queryContent;
 					 //this.queryContentBl=true
 					// 删除类型  delete data.list;
 					data=this.form
+					data.queryContent=this.queryContent;
+					
 				 }else{
 					 
 					  //this.queryContentBl=false
@@ -206,6 +239,7 @@
 					}
 					if(this.queryContent){
 						this.queryContentBl=true
+						this.form.recordsTotal = res.data.recordsTotal;
 					}else{
 						this.queryContentBl=false
 						this.menuList[this.checkindex].list=list
@@ -223,13 +257,13 @@
 				})
 			},
 			datainit(){
-				var data = this.menuList[this.checkindex];
-				 if(!data.pageIndex){
-					  this.menuList[this.checkindex].pageIndex=1;
-					 this.menuList[this.checkindex].pageSize=20
-					 this.menuList[this.checkindex].recordsTotal=0;
-					  this.menuList[this.checkindex].list=[]
-				 }
+				// var data = this.menuList[this.checkindex];
+				//  if(!data.pageIndex){
+				// 	  this.menuList[this.checkindex].pageIndex=1;
+				// 	 this.menuList[this.checkindex].pageSize=10
+				// 	 this.menuList[this.checkindex].recordsTotal=0;
+				// 	  this.menuList[this.checkindex].list=[]
+				//  }
 			},
 			toggle(index) {
 				this.checkindex = index
@@ -336,9 +370,9 @@
 	.type{
 		padding: 24rpx 32rpx;
 		height: calc(100vh - 88rpx);
-		overflow-y: scroll;
+		
 		.type-item{
-			margin-bottom: 80rpx;
+			//margin-bottom: 80rpx;
 		}
 		.title{
 			color: rgba(51, 51, 51, 1);
@@ -348,7 +382,8 @@
 		.content{
 			.item{
 				display: flex;
-				margin-bottom: 64rpx;
+				margin-bottom: 34rpx;
+				border-bottom: 1px dashed;
 				.option{
 					padding-left: 20rpx;
 				}
@@ -363,6 +398,9 @@
 						
 					}
 				}
+				.infosQuery{
+					width:400rpx !important;
+				}
 				.infos{
 					width:200rpx ;
 					margin-left: 16rpx;

+ 1 - 1
pages/index/homePage.vue

@@ -8,7 +8,7 @@
 				<view class="title">
 					<view class="name"  @click="changeShow()">
 						<view class="text">
-							你好,孙斌
+							你好,{{userInfo.name}}
 						</view>
 						<view class="icon">
 							<u-icon name='arrow-down' color="#fff" size="28"></u-icon>

+ 54 - 7
pages/projectDepartment/branch/exportApplication/deliveryDetails.vue

@@ -8,13 +8,13 @@
 				<img src="@/assets/img/photoCopy 3@1x.png" alt="">
 			</view>
 			<view class="name">
-				刘群
+				{{info.createByName}}
 			</view>
 			<view class="submit">
 				提交了<text>出库申请</text>
 			</view>
 			<view class="state">
-				待出库
+				{{recordStatus(info.status)}}
 			</view>
 		</view>
 		<!-- 出库单详情 -->
@@ -24,7 +24,7 @@
 					所属项目
 				</view>
 				<view class="value">
-					洪湖文泉110kV变电站二期
+					{{info.projectName}}
 				</view>
 			</view>
 			<view class="item">
@@ -32,7 +32,7 @@
 					需求时间
 				</view>
 				<view class="value">
-					
+					{{info.startTime}}
 				</view>
 			</view>
 			<view class="item">
@@ -40,7 +40,7 @@
 					使用周期至
 				</view>
 				<view class="value">
-					2023年6月30日
+					{{info.endTime}}
 				</view>
 			</view>
 			<view class="item">
@@ -48,7 +48,7 @@
 					申请时间
 				</view>
 				<view class="value">
-					2023年3月27日 11:00
+					{{info.createTime}}
 				</view>
 			</view>
 
@@ -273,10 +273,57 @@
 </template>
 
 <script>
+	import * as API from '@/apis/pagejs/projectDepartment.js'
+	import {
+		recordStatus
+	} from '@/apis/pagejs/projectDepartment.js'
 	export default {
 		data() {
 			return {
-
+				id:"",
+				info:{},
+				outRecordDeviceList:[]
+			}
+		},
+		onLoad(op){
+			this.id=op.id
+			this.getInfo()
+		},
+		methods: {
+			recordStatus,
+			getList(){
+				
+				API.outRecordDeviceById({
+					recordId:this.id,
+					pageSize:5,
+					pageIndex:1,
+				}).then((res) => {
+					uni.hideLoading();
+					this.outRecordDeviceList=res.data.outRecordDeviceList;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getInfo(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.outRecordDetail({
+					id:this.id,
+				}).then((res) => {
+					
+					this.info=res.data.outRecord;
+					this.getList()
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
 			}
 		}
 	}

+ 38 - 11
pages/projectDepartment/branch/exportApplication/deliveryFrom.vue

@@ -8,7 +8,7 @@
 		<view class="details">
 			<view class="item">
 				<view class="name">
-					所属项目
+					所属项目<span style="color: red;">*</span>
 				</view>
 				<view class="value">
 					
@@ -27,12 +27,12 @@
 			</view>
 			<view class="item">
 				<view class="name">
-					使用周期至
+					使用周期至<span style="color: red;">*</span>
 				</view>
 				<view class="value">
 					<u-calendar v-model="show" mode="date"  max-date="2099-01-01"  @change="change"></u-calendar>
 
-					<u-input v-model="endTime" @click="show=true,showText='endTime'"  placeholder="使用周期" 	 type="select" />
+					<u-input v-model="endTime" @click="show=true,showText='endTime'"  placeholder="请输入使用周期" 	 type="select" />
 				</view>
 			</view>
 		
@@ -53,7 +53,7 @@
 			<view class="list-infos" v-for="(item,index) in list"  :key="index" >
 				<view class="infos-head">
 					<view class="name">
-						接地线 220kV 无杆
+						{{item.obj.title}}
 					</view>
 					<view class="state">				
 						<u-icon name="minus-circle" ></u-icon>删除
@@ -66,19 +66,19 @@
 								型号:
 							</view>
 							<view class="item-value">
-								GZYV GYVZ-50
+								{{item.obj.model}}
 							</view>
 						</view>
 						<view class="infos-item">
 							<view class="item-name">
-								单位
+								库存
 							</view>
 							<view class="item-value">
-								
+								{{item.obj.count}}
 							</view>
 						</view>
 					</view>
-					<view class="infos-2">
+					<view class="infos-2" v-if="false">
 						<view class="infos-item">
 							<view class="item-name">
 								单位:
@@ -120,17 +120,17 @@
 				<view class="search"  >
 					
 					<view class="search-box">
-						<u-search placeholder="搜索设备名称或型号" :show-action="false">
+						<u-search placeholder="搜索设备名称或型号"  v-model="queryContent" :show-action="false">
 				
 						</u-search>
-						<view class="search-btn">
+						<view class="search-btn"  @click="ckQueryContent"  >
 							<view class="text">
 								搜索
 							</view>
 						</view>
 					</view>
 				</view>
-				<scroll-view scroll-y="true" style="height: 800rpx;">
+				<scroll-view scroll-y="true" style="height: 800rpx;" @scrolltolower="refscrolltolower()">
 					
 				
 				<equipmentRetrieval  @ckItem="ckItem" ref="equipmentRetrievalRef" :iscomponents="1"></equipmentRetrieval>
@@ -163,6 +163,7 @@
 				showpopup:false,
 				endTime:'',
 				needTime:'',
+				queryContent:'',
 				list:[]
 			}
 		},
@@ -173,11 +174,37 @@
 			 
 		},
 		methods:{
+			refscrolltolower(){
+				this.$refs.equipmentRetrievalRef.myLoadmoreonReachBottom()
+			},
+			ckQueryContent(){
+				this.$refs.equipmentRetrievalRef.queryContent=this.queryContent
+				this.$refs.equipmentRetrievalRef.getList()
+			},
 			change(e){
 				this.form[this.showText]=e.result;
 				this[this.showText]=e.year+"年"+e.month+"月"+e.day+"日"
 			},
 			submit(){
+				if(!this.form.projectName){
+					uni.showToast({
+						title: "请填写所属项目"
+					})
+					return
+				}
+				if(!this.form.endTime){
+					uni.showToast({
+						title: "请输入使用周期"
+					})
+					return
+				}
+				
+				if(this.list.length==0){
+					uni.showToast({
+						title: "请添加设备"
+					})
+					return
+				}
 				var list=this.list.map(item=>{
 					var obj={
 						...item

+ 1 - 1
uni_modules/uview-ui/components/u-upload-file/u-upload-file.vue

@@ -170,7 +170,7 @@ export default {
 		// 是否开启图片多选,部分安卓机型不支持
 		multiple: {
 			type: Boolean,
-			default: true
+			default: false
 		},
 		// 是否展示删除按钮
 		deletable: {

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

@@ -163,7 +163,7 @@ export default {
 		// 是否开启图片多选,部分安卓机型不支持
 		multiple: {
 			type: Boolean,
-			default: true
+			default: false
 		},
 		// 是否展示删除按钮
 		deletable: {