ysy há 2 anos atrás
pai
commit
a612622bb0

+ 11 - 20
pages/pda/jobBooking/components/aridRegion.vue → pages/pda/feeding/components/aridRegion.vue

@@ -4,7 +4,7 @@
 			<view class="name">干燥区</view>
 		</view>
 
-		<view v-for="(item, index) in newList" :key='index'>
+		<view v-for="(item, index) in list" :key='index'>
 			<view class="title_box rx-bc">
 				<view class="left rx-ss" @click="getDelete(index)">
 					<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
@@ -23,11 +23,12 @@
 						<view class="lable rx-cc">编号</view>
 						<view class="content rx-bc">
 							<view>{{item.code}}</view>
-							<view :style="{ color:  item.status == 0 ? '#157A2C' :'#FFA929' }"  >{{ item.status == 0 ? '空闲' : item.status == 1 ? '占用' : ''}}</view>
+							<view :style="{ color:  item.status == 0 ? '#157A2C' :'#FFA929' }">
+								{{ item.status == 0 ? '空闲' : item.status == 1 ? '占用' : ''}}</view>
 						</view>
 					</view>
 
-                    
+
 
 					<view class="item">
 						<view class="lable rx-cc">名称</view>
@@ -36,7 +37,7 @@
 
 					<view class="item">
 						<view class="lable rx-cc">位置</view>
-						<view class="content">{{ item.region }}  </view>
+						<view class="content">{{ item.region }} </view>
 					</view>
 
 
@@ -87,22 +88,12 @@
 		},
 
 
-		watch: {
-
-			list: {
-				immediate: true,
-				deep: true,
-				handler(newVal) {
-					this.newList = newVal
 
-				}
-			}
-		},
 
 		data() {
 			return {
 				occupationTime: null,
-				newList: [],
+
 
 			}
 		},
@@ -116,14 +107,14 @@
 			},
 
 			getDelete(index) {
-				this.$emit('handleDel', index, 'aridRegion')
+				this.list.splice(index, 1)
 			},
 
 			timeInp() {
-					this.newList.forEach(e => {
-						e.occupationTime = this.occupationTime
-					})
-			
+				this.list.forEach(e => {
+					e.occupationTime = this.occupationTime
+				})
+
 
 			}
 		}

+ 64 - 12
pages/pda/feeding/details.vue

@@ -19,6 +19,11 @@
 						:list='item.instanceList'></instanceBom>
 
 
+					<aridRegion v-if='item.aridRegionList.length != 0' :list='item.aridRegionList'
+						@handleScan='handleScan'></aridRegion>
+
+
+
 					<view class="operate_box rx-sc">
 						<u-button size="small" class="u-reset-button" type="success"
 							@click="handAdd(item.workOrderId)">手动添加</u-button>
@@ -45,6 +50,7 @@
 	import deviceBom from './components/deviceBom.vue'
 	import modelBom from './components/modelBom.vue'
 	import instanceBom from './components/instanceBom.vue'
+	import aridRegion from './components/aridRegion'
 	import {
 		workorderList,
 		getByCode,
@@ -62,7 +68,8 @@
 			workOrderBom,
 			deviceBom,
 			modelBom,
-			instanceBom
+			instanceBom,
+			aridRegion
 		},
 		data() {
 			return {
@@ -95,6 +102,7 @@
 					if (m.workOrderId == id) {
 						let modelList = [] // 模具
 						let instanceList = [] // 投料
+						let aridRegionList = [] // 干燥区
 
 						selectList.forEach(f => {
 							if (f.rootCategoryLevelId == 5) {
@@ -103,6 +111,8 @@
 							} else if (f.rootCategoryLevelId == 1) {
 								instanceList = instanceList.concat(f)
 
+							} else if (f.rootCategoryLevelId == 11) {
+								aridRegionList = aridRegionList.concat(f)
 							}
 
 						})
@@ -110,6 +120,7 @@
 
 						this.$set(m, 'modelList', modelList)
 						this.$set(m, 'instanceList', instanceList)
+						this.$set(m, 'aridRegionList', aridRegionList)
 
 
 					}
@@ -120,6 +131,7 @@
 
 
 
+
 			});
 
 		},
@@ -128,19 +140,25 @@
 			scrolltolower() {},
 
 			save() {
-				let _arr = []
-				_arr = this.List.map(m => {
 
-					return {
-						...m
-					}
+				this.List.every(m => {
+
 
 				})
 
+				// if(this.objData.aridRegionList.length > 0) {
+				// 			if(!this.objData.aridRegionList[0].occupationTime) {
+				// 				uni.showToast({
+				// 					title: '请输入干燥时间',
+				// 					icon: 'none'
+				// 				})
+				// 				return false
+				// 			}
+				// 		}
 
 				console.log(_arr)
-
-				batchSave(_arr).then(res => {
+				return false
+				batchSave(this.List).then(res => {
 
 					uni.navigateTo({
 						url: `/pages/pda/feeding/index/index?feedStatus=1`,
@@ -156,6 +174,7 @@
 						m.equipmentList = [] // 设备
 						m.modelList = [] // 模具
 						m.instanceList = [] // 投料
+						m.aridRegionList = [] // 干燥区
 						delete m.id
 						if (this.taskId) {
 							m.taskId = this.taskId
@@ -172,6 +191,7 @@
 
 
 
+
 			handleScan(id, type) {
 				console.log(id)
 				console.log(type)
@@ -222,8 +242,9 @@
 				// CX-EQ-YLSJL-008	  设备
 				// M001 M002 模具 
 				//  S310000552731 物料
-				// this.scanItData('S310000552731', id)
-				// return false
+				//               干燥区 
+				this.scanItData('GZQ026173007-D', id)
+				return false
 
 				let _this = this
 				uni.scanCode({
@@ -236,13 +257,13 @@
 
 			scanItData(result, id) {
 				scanLedger(result).then(res => {
-
+					console.log(res)
 					let _arr = []
 					if (res.length == 1 && res[0].rootCategoryLevelId == 4) { // 设备
 						_arr = this.List
 						_arr.forEach((e, index) => {
 							if (e.workOrderId == id) {
-								
+
 								_arr[index].equipmentList = res
 							}
 						})
@@ -272,6 +293,37 @@
 
 						this.$forceUpdate()
 
+					} else if (res.length >= 1 && res[0].rootCategoryLevelId == 11) { // 干燥区
+						_arr = this.List
+						_arr.forEach((e, index) => {
+							if (e.workOrderId == id) {
+								let isFals = _arr[index].aridRegionList.some(m => m.code == res[0]
+									.aridRegionList[0].code)
+								if (isFals) {
+									uni.showToast({
+										title: '干燥区已存在',
+										icon: 'none'
+									})
+									return false
+								}
+								let _obj = res[0].aridRegionList[0]
+								if (_obj.status == 0) {
+									_obj['name'] = res[0].name
+									_obj['region'] = res[0].extInfo.region
+									_arr[index].aridRegionList = _arr[index].aridRegionList.concat(res[0]
+										.aridRegionList)
+								} else {
+									uni.showToast({
+										title: '干燥区已占用',
+										icon: 'none'
+									})
+								}
+
+							}
+						})
+						this.List = _arr
+
+						this.$forceUpdate()
 					}
 
 				})

+ 5 - 21
pages/pda/jobBooking/index/index.vue

@@ -65,7 +65,7 @@
 	import jobBom from '../components/jobBom.vue'
 	import byProductBom from '../components/byProductBom'
 	import turnoverBom from '../components/turnoverBom.vue'
-	import aridRegion from '../components/aridRegion.vue'
+	import aridRegion from '../../feeding/components/aridRegion.vue'
 
 
 	export default {
@@ -113,7 +113,7 @@
 			uni.$on("setSelectList", (selectList, id) => {
 
 				let turnover = []
-				let aridRegionList = []
+			
 
 
 				selectList.forEach(f => {
@@ -122,15 +122,10 @@
 					}
 				})
 
-				selectList.forEach(f => {
-					if (f.rootCategoryLevelId == 11) { // 干燥区
-						aridRegionList = aridRegionList.concat(f)
-					}
-				})
+			
 
 
 				this.$set(this.objData, 'turnover', turnover)
-				this.$set(this.objData, 'aridRegionList', aridRegionList)
 				this.$forceUpdate()
 
 
@@ -221,10 +216,7 @@
 					this.$forceUpdate()
 				}
 
-				if (type == 'aridRegion') {
-					this.objData.aridRegionList.splice(idx, 1)
-					this.$forceUpdate()
-				}
+			
 			},
 
 			handleScan(id, type) {
@@ -298,15 +290,7 @@
 
 
 			save() {
-				if(this.objData.aridRegionList.length > 0) {
-					if(!this.objData.aridRegionList[0].occupationTime) {
-						uni.showToast({
-							title: '请输入干燥时间',
-							icon: 'none'
-						})
-						return false
-					}
-				}
+		
 				
 			}
 		}

+ 13 - 5
pages/pda/workOrder/extrusionMolding/index.vue

@@ -252,11 +252,19 @@
 					}
 
 				} else if (type == 'jobBooking') {
-					url = '/pages/pda/jobBooking/index/index'
-					url += `?id=${this.info.id}&taskId=${this.taskId }&taskName=${this.info.taskName}`
-					uni.navigateTo({
-						url
-					})
+					if (!this.feedAllow) {
+						url = '/pages/pda/jobBooking/index/index'
+						url += `?id=${this.info.id}&taskId=${this.taskId }&taskName=${this.info.taskName}`
+						uni.navigateTo({
+							url
+						})
+					} else {
+						uni.showToast({
+							title: "请先投料",
+							icon: "none",
+						})
+					}
+			
 				}
 
 			},

+ 4 - 4
pages/pda/workOrder/search/index.vue

@@ -175,7 +175,7 @@
 
 				if (this.isType == 'feed') {
 					let _arr = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
-					this.memoList = [..._arr[0].modelList, ..._arr[0].equipmentList, ..._arr[0].instanceList]
+					this.memoList = [..._arr[0].modelList, ..._arr[0].equipmentList, ..._arr[0].instanceList, ..._arr[0].aridRegionList]
 
 
 
@@ -183,7 +183,7 @@
 					this.memoList = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
 				} else if (this.isType == 'job') {
 					let _obj = (this.storageKey && uni.getStorageSync(this.storageKey)) || {}
-					this.memoList = [..._obj.turnover, ..._obj.aridRegionList]
+					this.memoList = [..._obj.turnover]
 
 				}
 
@@ -244,11 +244,11 @@
 			getTreeList() {
 				let params = {}
 				if (this.isType == 'feed') {
-					params.ids = [1, 5, 7, 8, 10, 14]
+					params.ids = [1, 5, 7, 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, 11]
+					params['ids'] = [ 7 ]
 				}
 
 				treeByPid(params).then(res => {