Browse Source

设备添加

ysy 2 years ago
parent
commit
0faed421cd

+ 16 - 5
pages/pda/feeding/details.vue

@@ -109,15 +109,25 @@
 			uni.$off("setSelectList");
 
 			uni.$on("setSelectList", (selectList, id) => {
-				console.log(selectList)
+
 				this.List.forEach(m => {
 					if (m.workOrderId == id) {
 						let modelList = [] // 模具
 						let instanceList = [] // 投料
 						let aridRegionList = [] // 干燥区
-
+						let equipmentList = [] // 生产设备
+						let isEquipment = m.equipmentList.length > 0 ? true : false // 判断是否有设置
 
 						selectList.forEach(f => {
+							if (f.rootCategoryLevelId == 4) {
+								if (isEquipment) {
+									equipmentList = m.equipmentList
+								} else {
+									equipmentList = equipmentList.concat(f)
+								}
+
+
+							}
 							if (f.rootCategoryLevelId == 5) {
 								modelList = modelList.concat(f)
 
@@ -134,6 +144,7 @@
 						this.$set(m, 'modelList', modelList)
 						this.$set(m, 'instanceList', instanceList)
 						this.$set(m, 'aridRegionList', aridRegionList)
+						this.$set(m, 'equipmentList', equipmentList)
 
 
 					}
@@ -176,11 +187,11 @@
 						if (!m.hasOwnProperty('equipmentList')) {
 							m.equipmentList = [] // 设备
 						}
-						
+
 						if (!m.hasOwnProperty('modelList')) {
 							m.modelList = [] // 模具
 						}
-						
+
 						if (!m.hasOwnProperty('instanceList')) {
 							m.instanceList = [] // 投料
 						}
@@ -189,7 +200,7 @@
 						}
 
 
-					
+
 
 						delete m.id
 						if (this.taskId) {

+ 33 - 23
pages/pda/jobBooking/index/index.vue

@@ -9,8 +9,8 @@
 
 				<view class="card_box">
 					<workOrderBom :item='objData' v-if='objData' @handleScan='handleScan'></workOrderBom>
-					
-					<paramBom v-if='paramDetailList.length != 0' :list='paramDetailList' ></paramBom>
+
+					<paramBom v-if='paramDetailList.length != 0' :list='paramDetailList'></paramBom>
 
 					<deviceBom v-if='objData.equipmentList.length != 0' :list='objData.equipmentList'></deviceBom>
 
@@ -26,14 +26,14 @@
 						@penalize='penalize'>
 					</byProductBom>
 
-					<turnoverBom v-if='objData.turnover.length != 0' :list='objData.turnover' :wordItem='objData' pattern='job'
-						@handleScan='handleScan'>
+					<turnoverBom v-if='objData.turnover.length != 0' :list='objData.turnover' :wordItem='objData'
+						pattern='job' @handleScan='handleScan'>
 					</turnoverBom>
 
 
 
-					<aridRegion v-if='objData.aridRegionList.length != 0' :list='objData.aridRegionList' :remainingTime='remainingTime'
-						@handleScan='handleScan' :isType='true'></aridRegion>
+					<aridRegion v-if='objData.aridRegionList.length != 0' :list='objData.aridRegionList'
+						:remainingTime='remainingTime' @handleScan='handleScan' :isType='true'></aridRegion>
 
 					<view class="operate_box rx-sc">
 						<u-button size="small" class="u-reset-button" type="success" @click="handAdd">手动添加</u-button>
@@ -57,8 +57,8 @@
 
 					<u-form labelPosition="left" :model="formData" labelWidth="180" labelAlign="left" class="baseForm">
 						<u-form-item label="仓库:" class="required-form" borderBottom prop="warehouseId">
-							<zxz-uni-data-select :localdata="warehouseList"  v-model="formData.warehouseId"
-								dataValue='id' dataKey="name" filterable format='{name}' ></zxz-uni-data-select>
+							<zxz-uni-data-select :localdata="warehouseList" v-model="formData.warehouseId"
+								dataValue='id' dataKey="name" filterable format='{name}'></zxz-uni-data-select>
 						</u-form-item>
 
 
@@ -152,9 +152,9 @@
 				penalizeIndex: null,
 
 
-                paramDetailList: [],
+				paramDetailList: [],
 				remainingTime: 0,
-				
+
 
 
 				id: null,
@@ -175,10 +175,20 @@
 			uni.$on("setSelectList", (selectList, id) => {
 
 				let turnover = []
-
+				let equipmentList = [] // 生产设备
+				let isEquipment = this.objData.equipmentList.length > 0 ? true : false // 判断是否有设置
 
 
 				selectList.forEach(f => {
+					if (f.rootCategoryLevelId == 4) { // 生产设备
+						if (isEquipment) {
+							equipmentList = this.objData.equipmentList
+						} else {
+							equipmentList = equipmentList.concat(f)
+						}
+
+
+					}
 					if (f.rootCategoryLevelId == 7) { // 周转车
 						turnover = turnover.concat(f)
 					}
@@ -186,7 +196,7 @@
 
 
 
-
+				this.$set(this.objData, 'equipmentList', equipmentList)
 				this.$set(this.objData, 'turnover', turnover)
 				this.$forceUpdate()
 
@@ -363,20 +373,20 @@
 					this.objData.workReportInfo.unit = res.unit
 					this.objData.workReportInfo.weightUnit = res.weightUnit
 					this.objData.workReportInfo.workOrderId = res.workOrderId
-					
+
 					this.paramDetailList = []
-					
+
 					this.paramDetailList = res.paramDetailList.map(m => {
-						if(m.extInfo.textType == 5) {
+						if (m.extInfo.textType == 5) {
 							this.remainingTime = m.extInfo.remainingTime
 						}
-						 return {
-							 ...m.extInfo
-						 }
+						return {
+							...m.extInfo
+						}
 					})
-					
-				
-					
+
+
+
 
 				})
 			},
@@ -412,7 +422,7 @@
 					this.searchShow = true
 				}
 			},
-			
+
 			inputChange(e) {
 				console.log(e)
 			},
@@ -453,7 +463,7 @@
 				// }
 
 
-			
+
 
 				if (this.objData.notFormedList[0].notFormedNum > 0 && !this.objData.notFormedList[0].warehouseId) {
 					uni.showToast({

+ 200 - 0
pages/pda/picking/components/modelBom.vue

@@ -0,0 +1,200 @@
+<template>
+	<view>
+		<view class="title_box rx-bc">
+			<view class="name">模具信息</view>
+
+
+		</view>
+
+
+		<view class="material ">
+
+		</view>
+
+
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			workOrderId: {
+				type: String,
+				default: ''
+			},
+			list: {
+				type: Array,
+				default: () => []
+			},
+		},
+		data() {
+			return {
+
+			}
+		},
+		methods: {
+			tableH(type) {
+				return tableHeader(type)
+			},
+
+			handleScan(id) {
+				this.$emit('scanIt', id)
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.title_box {
+		margin-top: 20rpx;
+
+		.name {
+			font-size: 28rpx;
+			font-style: normal;
+			font-weight: 400;
+			color: $theme-color;
+			padding-left: 20rpx;
+
+			position: relative;
+
+			&:before {
+				position: absolute;
+				content: '';
+				left: 0rpx;
+				top: 0rpx;
+				bottom: 0rpx;
+				width: 4rpx;
+				height: 28rpx;
+				background: $theme-color;
+				margin: auto;
+			}
+
+
+		}
+
+		.btn_box {
+			padding: 0 18rpx;
+			height: 60rpx;
+			background: $theme-color;
+			font-size: 26rpx;
+			font-style: normal;
+			font-weight: 400;
+			font-size: 24rpx;
+			color: #fff;
+			border-radius: 4rpx;
+
+			.scan {
+				width: 34rpx;
+				height: 34rpx;
+				margin-right: 12rpx;
+
+			}
+
+		}
+
+	}
+
+
+	.material {
+		margin-top: 10rpx;
+
+
+
+		.content_table {
+			width: 100%;
+			border: 2rpx solid $border-color;
+
+			.item {
+				display: flex;
+				border-bottom: 1rpx dotted $border-color;
+
+
+				.lable {
+					width: 132rpx;
+					text-align: center;
+					background-color: #F7F9FA;
+					font-size: 26rpx;
+					border-right: 2rpx solid $border-color;
+					flex-shrink: 0;
+				}
+
+				.lable150 {
+					width: 156rpx !important;
+					font-size: 24rpx;
+				}
+
+
+				.lable300 {
+					width: 300rpx !important;
+					padding-left: 14rpx;
+					font-size: 24rpx;
+				}
+
+
+				.ww80 {
+					width: 80rpx;
+				}
+
+				.content {
+					width: 518rpx;
+					min-height: 64rpx;
+					font-size: 28rpx;
+					line-height: 28rpx;
+					font-style: normal;
+					font-weight: 400;
+					padding: 18rpx 8rpx;
+					box-sizing: border-box;
+					word-wrap: break-word;
+					flex-grow: 1 !important;
+
+
+					.unit {
+						padding: 0 4rpx;
+						font-size: 24rpx;
+						color: #404446;
+					}
+
+				}
+
+				.content_num {
+					display: flex;
+					align-items: center;
+					padding: 0 4rpx;
+
+					/deep/ .uni-input-input {
+						border: 2rpx solid #F0F8F2;
+						background: #F0F8F2;
+						color: $theme-color;
+					}
+
+
+				}
+
+				.pd4 {
+					padding: 4rpx 8rpx;
+				}
+
+
+
+				&:last-child {
+					border-bottom: none;
+				}
+			}
+
+
+			.bot_border {
+				border-bottom: 2rpx solid $theme-color;
+			}
+
+			.ww55 {
+				width: 55%;
+			}
+
+			.ww45 {
+				width: 45%;
+			}
+		}
+
+
+	}
+</style>

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

@@ -99,7 +99,7 @@
 
 <script>
 	import instanceBom from './components/instanceBom.vue'
-	import modelBom from '../feeding/components/modelBom.vue'
+	import modelBom from './components/modelBom.vue'
 	import {
 		workorderList
 	} from '@/api/pda/workOrder.js'

+ 47 - 27
pages/pda/workOrder/search/index.vue

@@ -29,9 +29,10 @@
 				<checkbox-group v-for="(item, index) in list" :key="index" @change="e => selectVal(e, item, index)">
 					<label class="listBox rx-bs">
 
-						<view class="listBox-sel" >
-							<checkbox  v-if='item.rootCategoryLevelId != 11 || (item.rootCategoryLevelId == 11 && item.status != 1)':value="item.code" color="#fff" :disabled="item.disabled"
-								:checked="item.checked" />
+						<view class="listBox-sel">
+							<checkbox
+								v-if='item.rootCategoryLevelId != 11 || (item.rootCategoryLevelId == 11 && item.status != 1)'
+								:value="item.code" color="#fff" :disabled="item.disabled" :checked="item.checked" />
 						</view>
 
 						<view class="listBox-con">
@@ -45,35 +46,37 @@
 									class="items" v-if="!itm.formatter">
 									{{ itm.label }}:{{ item[itm.prop] }}
 								</view>
-								
+
 								<view v-for="(itm, index) in tableH(item.rootCategoryLevelId)" :key="index"
 									class="items" v-if="itm.formatter">
-									{{ itm.label }}:{{  itm.formatter(item) }}
+									{{ itm.label }}:{{ itm.formatter(item) }}
 								</view>
-								
-								
-								
-								
 
-								<view class="items" v-if='item.rootCategoryLevelId != 11 && item.rootCategoryLevelId != 1'>
+
+
+
+
+								<view class="items"
+									v-if='item.rootCategoryLevelId != 11 && item.rootCategoryLevelId != 1'>
 									可用库存:{{ item.packingCountBase }} {{item.unit}}
 								</view>
-								
+
 								<view class="items" v-if='item.rootCategoryLevelId == 11'>
-								  	<text    :style="{ color:  item.status == 0 ? '#157A2C' :'#FFA929' }"   >状态:{{ item.status == 0 ? '空闲' : item.status == 1 ? '占用' : ''}}</text>
+									<text
+										:style="{ color:  item.status == 0 ? '#157A2C' :'#FFA929' }">状态:{{ item.status == 0 ? '空闲' : item.status == 1 ? '占用' : ''}}</text>
 								</view>
-								
-								
-							
-	
-						
+
+
+
+
+
 								<view class="items" v-if='item.rootCategoryLevelId == 11'>
 									位置:{{ item.region }}
 								</view>
-								
-							
-								
-									
+
+
+
+
 
 							</view>
 
@@ -179,7 +182,9 @@
 
 				if (this.isType == 'feed') {
 					let _arr = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
-					this.memoList = [..._arr[0].modelList, ..._arr[0].equipmentList, ..._arr[0].instanceList, ..._arr[0].aridRegionList, ..._arr[0].turnover]
+					this.memoList = [..._arr[0].modelList, ..._arr[0].equipmentList, ..._arr[0].instanceList, ..._arr[0]
+						.aridRegionList, ..._arr[0].turnover
+					]
 
 
 
@@ -248,11 +253,11 @@
 			getTreeList() {
 				let params = {}
 				if (this.isType == 'feed') {
-					params.ids = [1, 5,  8, 10, 11, 14]
+					params.ids = [1, 4, 5, 8, 10, 11, 14]
 				} else if (this.isType == 'pick') {
 					params.ids = [1, 5, 7, 8, 10, 14]
 				} else if (this.isType == 'job') {
-					params['ids'] = [ 7 ]
+					params['ids'] = [4, 7]
 				}
 
 				treeByPid(params).then(res => {
@@ -330,7 +335,7 @@
 						})
 
 
-					
+
 
 					} else {
 						this.list.push(
@@ -360,7 +365,7 @@
 			//勾选
 			selectVal(e, val, index) {
 				console.log(val)
-				if(val.rootCategoryLevelId == 11 && val.status == 1) {
+				if (val.rootCategoryLevelId == 11 && val.status == 1) {
 					return false
 				}
 				this.list[index].checked = !this.list[index].checked
@@ -386,6 +391,21 @@
 
 			//跳转回添加页面
 			jumpAdd() {
+				let equipmentList = []
+				if (this.isType == 'feed' || this.isType == 'job') {
+					this.memoList.forEach(f => {
+						if (f.rootCategoryLevelId == 4) {
+							equipmentList.push(f)
+						}
+					})
+				}
+				if (equipmentList.length > 1) {
+					uni.showToast({
+						title: '只能勾选一个设备',
+						icon: 'none'
+					})
+					return false
+				}
 				if (this.isType == 'pick' || this.isType == 'feed' || this.isType == 'job') {
 					uni.$emit('setSelectList', this.memoList, this.pid)
 					uni.navigateBack()
@@ -475,7 +495,7 @@
 				width: 50%;
 				margin-top: 8rpx;
 			}
-		
+
 		}
 	}
 </style>