ysy 2 лет назад
Родитель
Сommit
da19f86433

+ 3 - 3
api/pda/picking.js

@@ -15,9 +15,9 @@ export async function batchSave(params) {
 
 
 
 
 // 统计领料数量
 // 统计领料数量
-export async function pickStatistics() {
-  const data = await postJ(
-   Vue.prototype.apiUrl  + `/pda/mes/workorder/pickStatistics`, {}, true,
+export async function pickStatistics(params) {
+  const data = await post(
+   Vue.prototype.apiUrl  + `/pda/mes/workorder/pickStatistics`, params, true,
   );
   );
   if (data.code == 0) {
   if (data.code == 0) {
     return data.data;
     return data.data;

+ 14 - 0
api/pda/workOrder.js

@@ -75,6 +75,20 @@ export async function  pageeLedgerMain(params) {
   return Promise.reject(data.message);
   return Promise.reject(data.message);
 }
 }
 
 
+// 资产台账
+export async function  assetPage(params) {
+  const data = await get(
+   Vue.prototype.apiUrl  + `/main/asset/page`, params,  true,
+  );
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}
+
+
+
+
 // 生产明细
 // 生产明细
 export async function produceDetail(id) {
 export async function produceDetail(id) {
   const data = await get(
   const data = await get(

+ 1 - 0
main.js

@@ -67,3 +67,4 @@ export function createApp() {
   };
   };
 }
 }
 // #endif
 // #endif
+  

+ 74 - 67
pages/pda/feeding/details.vue

@@ -7,11 +7,15 @@
 			<u-list @scrolltolower="scrolltolower">
 			<u-list @scrolltolower="scrolltolower">
 				<view v-for="(item,index) in List" :key="index" class="card_box">
 				<view v-for="(item,index) in List" :key="index" class="card_box">
 					<workOrderBom :item='item' @handleScan='handleScan'></workOrderBom>
 					<workOrderBom :item='item' @handleScan='handleScan'></workOrderBom>
-					<deviceBom :item.workOrderId='item.workOrderId' :list='item.device' @scanIt='scanIt'></deviceBom>
-						<view class="operate_box rx-sc">
-							<u-button size="small" class="u-reset-button" type="success" @click="handAdd(item.workOrderId)" >手动添加</u-button>
-							<u-button size="small" class="u-reset-button" type="success" @click="scanIt(item.workOrderId)">扫一扫</u-button>
-						</view>
+
+					<deviceBom v-if='item.device.length != 0' :workOrderId='item.workOrderId' :list='item.device'
+						@scanIt='scanIt'></deviceBom>
+					<view class="operate_box rx-sc">
+						<u-button size="small" class="u-reset-button" type="success"
+							@click="handAdd(item.workOrderId)">手动添加</u-button>
+						<u-button size="small" class="u-reset-button" type="success"
+							@click="scanIt(item.workOrderId)">扫一扫</u-button>
+					</view>
 				</view>
 				</view>
 			</u-list>
 			</u-list>
 
 
@@ -118,13 +122,13 @@
 
 
 
 
 
 
-		
+
 
 
 			handleScan(id, type) {
 			handleScan(id, type) {
 				console.log(id)
 				console.log(id)
 				console.log(type)
 				console.log(type)
 
 
-				this.scanData('SCJHGD2024011700222', type, id)
+				this.scanData('SCJHGD20240117002', type, id)
 				return false
 				return false
 
 
 				// let _this = this
 				// let _this = this
@@ -142,70 +146,72 @@
 					let isFals = this.List.some(m => m.code == result)
 					let isFals = this.List.some(m => m.code == result)
 					if (isFals) {
 					if (isFals) {
 						uni.showToast({
 						uni.showToast({
-								title: '工单已存在',
-								icon: 'none'
-							})
-							return false
-						}
+							title: '工单已存在',
+							icon: 'none'
+						})
+						return false
+					}
 
 
-						getByCode(result).then(res => {
-							let _arr = this.List
-							_arr.forEach((e, index) => {
-								if (e.workOrderId == id) {
-									_arr[index] = res
-								}
-							})
+					getByCode(result).then(res => {
+						let _arr = this.List
+						_arr.forEach((e, index) => {
+							if (e.workOrderId == id && res) {
+								_arr[index] = res
+							}
+						})
 
 
-							this.List = _arr
-							this.$forceUpdate()
+						this.List = _arr
+						this.$forceUpdate()
 
 
 
 
-						})
+					})
+				}
+
+			},
+			scanIt(id) {
+				console.log(id)
+
+				this.scanItData('CX-EQ-YLSJL-016', id)
+				return false
+
+				let _this = this
+				uni.scanCode({
+					success: function(res) {
+						_this.scanItData(res.result, id)
 					}
 					}
+				})
+			},
 
 
-				},
-				scanIt(id) {
-					console.log(id)
-					
-					this.scanItData('CX-EQ-YLSJL-016', id)
-					return false
-					
-					let _this = this
-					uni.scanCode({
-						success: function(res) {
-							_this.scanItData(res.result, id)
-						}
-					})
-				},
-				
-				scanItData(result,id) {
-					scanLedger(result).then(res => {
-						console.log(res)
-							let _arr = []
-						if(res.rootCategoryLevelId == 4) { // 设备
+			scanItData(result, id) {
+				scanLedger(result).then(res => {
+					console.log(res)
+					let _arr = []
+					if (res.rootCategoryLevelId == 4) { // 设备
 						_arr = this.List
 						_arr = this.List
-							_arr.forEach((e, index) => {
-								if (e.workOrderId == id) {
-									_arr[index].device = [res]
-								}
-							})
-							this.List = _arr
-							console.log(this.List)
-						}
-					})
-				},
-				
-				handAdd(id, list) {
-					const storageKey = Date.now() + "";
-					uni.setStorageSync(storageKey, list || []);
-					uni.navigateTo({
-						url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}`
-					})
-				},
+						_arr.forEach((e, index) => {
+							if (e.workOrderId == id) {
+								_arr[index].device = [res]
+							}
+						})
+						this.List = _arr
+
+					} else if (res.rootCategoryLevelId == 5) {
 
 
+					}
+				})
 			},
 			},
 
 
-		}
+			handAdd(id, list) {
+				const storageKey = Date.now() + "";
+				uni.setStorageSync(storageKey, list || []);
+				uni.navigateTo({
+					url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=feed`
+				})
+			},
+
+		},
+
+	}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
@@ -251,11 +257,12 @@
 			color: #fff;
 			color: #fff;
 		}
 		}
 	}
 	}
-	
-		.operate_box{
-			padding: 10rpx 32rpx;
-			/deep/ .u-button{
-				width: 40%;
-			}
+
+	.operate_box {
+		padding: 10rpx 160rpx;
+
+		/deep/ .u-button {
+			width: 140rpx;
 		}
 		}
+	}
 </style>
 </style>

+ 1 - 1
pages/pda/feeding/index/index.vue

@@ -214,7 +214,7 @@
 			},
 			},
 
 
 			getpickTics() {
 			getpickTics() {
-				pickStatistics().then(res => {
+				pickStatistics({ type: 'feedStatus'}).then(res => {
 					this.navObj = res
 					this.navObj = res
 				})
 				})
 			},
 			},

+ 1 - 1
pages/pda/picking/details.vue

@@ -188,7 +188,7 @@
 				const storageKey = Date.now() + "";
 				const storageKey = Date.now() + "";
 				uni.setStorageSync(storageKey, list || []);
 				uni.setStorageSync(storageKey, list || []);
 				uni.navigateTo({
 				uni.navigateTo({
-					url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}`
+					url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=pick`
 				})
 				})
 			},
 			},
 
 

+ 88 - 48
pages/pda/workOrder/search/index.vue

@@ -11,6 +11,7 @@
 
 
 
 
 		<view class="top-wrapper">
 		<view class="top-wrapper">
+
 			<view class="searchBox rx-bc">
 			<view class="searchBox rx-bc">
 				<input v-model="keyWord" placeholder="请输入关键字搜索" class="searchInput" />
 				<input v-model="keyWord" placeholder="请输入关键字搜索" class="searchInput" />
 
 
@@ -60,15 +61,15 @@
 				</checkbox-group>
 				</checkbox-group>
 
 
 
 
-			
-	            <view  v-if='list.length == 0' style='margin-top: 20vh;' >
+
+				<view v-if='list.length == 0' style='margin-top: 20vh;'>
 					<u-empty iconSize='150' textSize='32' text='暂无数据'>
 					<u-empty iconSize='150' textSize='32' text='暂无数据'>
 					</u-empty>
 					</u-empty>
 				</view>
 				</view>
 
 
 			</u-list>
 			</u-list>
-			
-			
+
+
 
 
 		</view>
 		</view>
 
 
@@ -99,7 +100,8 @@
 	} from '../../common.js'
 	} from '../../common.js'
 	import {
 	import {
 		treeByPid,
 		treeByPid,
-		pageeLedgerMain
+		pageeLedgerMain,
+		assetPage
 	} from '@/api/pda/workOrder.js'
 	} from '@/api/pda/workOrder.js'
 	export default {
 	export default {
 		components: {
 		components: {
@@ -117,6 +119,8 @@
 				seletedAll: false, //全选状态
 				seletedAll: false, //全选状态
 				memoList: [],
 				memoList: [],
 
 
+				isType: null,
+
 				pid: null, // 上个页面id
 				pid: null, // 上个页面id
 				storageKey: null
 				storageKey: null
 			}
 			}
@@ -132,6 +136,7 @@
 
 
 		onLoad(option) {
 		onLoad(option) {
 			this.pid = option.id
 			this.pid = option.id
+			this.isType = option.isType
 			if (option.storageKey) {
 			if (option.storageKey) {
 				this.storageKey = option.storageKey
 				this.storageKey = option.storageKey
 				this.memoList = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
 				this.memoList = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
@@ -188,80 +193,115 @@
 			},
 			},
 
 
 			getTreeList() {
 			getTreeList() {
-				let params = {
+                let params = {
 					ids: [1, 5, 7, 8, 10, 14]
 					ids: [1, 5, 7, 8, 10, 14]
-
 				}
 				}
+		
+
 				treeByPid(params).then(res => {
 				treeByPid(params).then(res => {
 					this.classificationList = res
 					this.classificationList = res
+					 console.log(res)
 					this.confirm([res[0].id], res[0].name)
 					this.confirm([res[0].id], res[0].name)
 				})
 				})
-			},
+			}
 
 
-			confirm(id, name) {
-				this.categoryLevelId = id
-				this.getList()
-			},
 
 
-			getList() {
-				let param = {
-					categoryLevelId: this.categoryLevelId,
-					keyWord: this.keyWord,
-					pageNum: 1,
-					size: -1,
-					dimension: 1 
-				}
-				this.list = []
+		},
+
+		confirm(id, name) {
+			this.categoryLevelId = id
+			this.getList()
+		},
+
+		getList() {
+			let param = {
+				categoryLevelId: this.categoryLevelId,
+				keyWord: this.keyWord,
+				pageNum: 1,
+				size: -1,
+				dimension: 1
+			}
+			this.list = []
+			if(this.isType == 'pick') {
+				
 				pageeLedgerMain(param).then(res => {
 				pageeLedgerMain(param).then(res => {
 					this.list.push(
 					this.list.push(
 						...res.list.map(i => {
 						...res.list.map(i => {
 							const checked =
 							const checked =
 								this.memoList.findIndex(itm => itm.id === i.id) > -1
 								this.memoList.findIndex(itm => itm.id === i.id) > -1
-                             
-							 const warehouseId = i.pathIds && i.pathIds.split(',')[0]
-						   
+				
+							const warehouseId = i.pathIds && i.pathIds.split(',')[0]
+				
 							return {
 							return {
 								checked,
 								checked,
 								warehouseId,
 								warehouseId,
 								...i,
 								...i,
 								instanceId: i.id,
 								instanceId: i.id,
 								categoryId: i.assetId,
 								categoryId: i.assetId,
-								
+				
 							}
 							}
 						})
 						})
 					)
 					)
 				})
 				})
-			},
+				
+			}
+		
+			
+			if(this.isType == 'feed') {
+				
+				assetPage(param).then(res => {
+					this.list.push(
+						...res.list.map(i => {
+							const checked =
+								this.memoList.findIndex(itm => itm.id === i.id) > -1
+				
+							const warehouseId = i.pathIds && i.pathIds.split(',')[0]
+				
+							return {
+								checked,
+								warehouseId,
+								...i,
+								instanceId: i.id,
+								categoryId: i.assetId,
+				
+							}
+						})
+					)
+				})
+				
+				
+			}
+		},
 
 
-			//勾选
-			selectVal(e, val, index) {
-				this.list[index].checked = !this.list[index].checked
+		//勾选
+		selectVal(e, val, index) {
+			this.list[index].checked = !this.list[index].checked
 
 
-				this.seletedAll = !this.list.some(item => !item.checked)
+			this.seletedAll = !this.list.some(item => !item.checked)
 
 
-				const idx = this.memoList.findIndex(
-					item => item.id === this.list[index].id
-				)
+			const idx = this.memoList.findIndex(
+				item => item.id === this.list[index].id
+			)
 
 
-				if (this.list[index].checked) {
-					if (idx === -1) {
-						this.memoList.push(this.list[index])
-					}
-				} else {
-					if (idx > -1) {
-						this.memoList.splice(idx, 1)
-					}
+			if (this.list[index].checked) {
+				if (idx === -1) {
+					this.memoList.push(this.list[index])
 				}
 				}
+			} else {
+				if (idx > -1) {
+					this.memoList.splice(idx, 1)
+				}
+			}
 
 
 
 
-			},
+		},
+
+		//跳转回添加页面
+		jumpAdd() {
+			uni.$emit('setSelectList', this.memoList, this.pid)
+			uni.navigateBack()
+		},
 
 
-			//跳转回添加页面
-			jumpAdd() {
-				uni.$emit('setSelectList', this.memoList, this.pid)
-				uni.navigateBack()
-			},
-		}
 	}
 	}
 </script>
 </script>