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

+ 8 - 1
components/ba-tree-picker/ba-tree-picker.vue

@@ -71,6 +71,7 @@
                   class="uni-flex-item uni-inline-item"
                   class="uni-flex-item uni-inline-item"
                   @tap.stop="_onItemSelect(item, index)"
                   @tap.stop="_onItemSelect(item, index)"
                 >
                 >
+			
                   <view class="item-name">
                   <view class="item-name">
                     {{
                     {{
                       item.name +
                       item.name +
@@ -241,13 +242,16 @@ export default {
     },
     },
     //格式化原数据(原数据为tree结构)
     //格式化原数据(原数据为tree结构)
     _formatTreeData (list = [], level = 0, parentItem, isShowChild = true) {
     _formatTreeData (list = [], level = 0, parentItem, isShowChild = true) {
+
       let nextIndex = 0
       let nextIndex = 0
       let parentId = -1
       let parentId = -1
       let initCheckStatus = 0
       let initCheckStatus = 0
+	
       if (parentItem) {
       if (parentItem) {
         nextIndex =
         nextIndex =
           this.treeList.findIndex(item => item.id === parentItem.id) + 1
           this.treeList.findIndex(item => item.id === parentItem.id) + 1
         parentId = parentItem.id
         parentId = parentItem.id
+		
         if (!this.multiple) {
         if (!this.multiple) {
           //单选
           //单选
           initCheckStatus = 0
           initCheckStatus = 0
@@ -273,6 +277,7 @@ export default {
           checkStatus: initCheckStatus,
           checkStatus: initCheckStatus,
           orCheckStatus: 0,
           orCheckStatus: 0,
           parentId,
           parentId,
+		 rootCategoryLevelId: item.rootCategoryLevelId,
           children: item[this.childrenKey],
           children: item[this.childrenKey],
           childCount: item[this.childrenKey]
           childCount: item[this.childrenKey]
             ? item[this.childrenKey].length
             ? item[this.childrenKey].length
@@ -349,10 +354,12 @@ export default {
 
 
         let selectedList = []
         let selectedList = []
         let selectedNames
         let selectedNames
+		let rootCategoryLevelId 
         selectedList.push(item.id)
         selectedList.push(item.id)
         selectedNames = item.name
         selectedNames = item.name
+		rootCategoryLevelId = item?.rootCategoryLevelId
         this._hide()
         this._hide()
-        this.$emit('select-change', selectedList, selectedNames)
+        this.$emit('select-change', selectedList, selectedNames, rootCategoryLevelId)
         return
         return
       }
       }
 
 

+ 13 - 0
pages/pda/common.js

@@ -99,6 +99,19 @@ export const tableHeader = selectEquiType => {
 			]
 			]
 		case 10:
 		case 10:
 			return []
 			return []
+			
+	    case 11:
+			return [
+				{
+					label: '位置',
+					prop: 'region'
+				},
+				{
+					label: '状态',
+					prop: 'region'
+				},
+			]
+				
 		case 14:
 		case 14:
 			return []
 			return []
 
 

+ 243 - 1
pages/pda/jobBooking/components/aridRegion.vue

@@ -1,8 +1,250 @@
 <template>
 <template>
+	<view>
+		<view class="title_box rx-bc">
+			<view class="name">干燥区</view>
+		</view>
+
+		<view v-for="(item, index) in newList" :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>
+				</view>
+				<view class="btn_box rx-bc" @click="handleScan(index)">
+					<image class="scan" src="@/static/pda/ScanIt.svg"></image>
+					更换干燥区
+				</view>
+			</view>
+
+
+			<view class="material ">
+
+				<view class="content_table">
+					<view class="item">
+						<view class="lable rx-cc">编号</view>
+						<view class="content rx-bc">
+							<view>{{item.code}}</view>
+							<view class="stateColor">空闲</view>
+						</view>
+					</view>
+
+
+
+					<view class="item">
+						<view class="lable rx-cc">名称</view>
+						<view class="content">{{ item.name }}</view>
+					</view>
+
+					<view class="item">
+						<view class="lable rx-cc">位置</view>
+						<view class="content">{{ item.region }}</view>
+					</view>
+
+
+
+
+				</view>
+			</view>
+
+
+
+
+
+
+		</view>
+	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	export default {
+		props: {
+			list: {
+				type: Array,
+				default: () => []
+			},
+			wordItem: {
+				type: Object,
+				default: () => {}
+			}
+		},
+
+
+		watch: {
+
+			list: {
+				immediate: true,
+				deep: true,
+				handler(newVal) {
+					this.newList = newVal
+
+				}
+			}
+		},
+
+		data() {
+			return {
+				recycleQuantity: '',
+				newList: []
+			}
+		},
+
+		methods: {
+
+
+
+			handleScan(index) {
+				this.$emit('handleScan', index, 'aridRegion')
+			},
+
+			getDelete(index) {
+				this.$emit('handleDel', index, 'aridRegion')
+
+
+			},
+		}
+	}
 </script>
 </script>
 
 
-<style>
+<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;
+			}
+
+
+		}
+
+		.left {
+			width: 40rpx;
+		}
+
+		.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: 2rpx solid $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;
+				}
+
+				.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;
+					}
+					.stateColor{
+						color: $theme-color;
+					}
+
+				}
+
+				.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;
+				}
+			}
+
+		}
+	}
 </style>
 </style>

+ 58 - 6
pages/pda/jobBooking/index/index.vue

@@ -24,7 +24,9 @@
 						@handleScan='handleScan' @handleDel='handleDel'>
 						@handleScan='handleScan' @handleDel='handleDel'>
 					</turnoverBom>
 					</turnoverBom>
 					
 					
-					<aridRegion></aridRegion>
+		
+					
+					<aridRegion v-if='objData.aridRegionList.length != 0' :list='objData.aridRegionList' @handleScan='handleScan' @handleDel='handleDel'></aridRegion>
 
 
 
 
 					<view class="operate_box rx-sc">
 					<view class="operate_box rx-sc">
@@ -84,7 +86,8 @@
 					equipmentList: [],
 					equipmentList: [],
 					modelList: [],
 					modelList: [],
 					turnover: [],
 					turnover: [],
-					productRecycleList: []
+					productRecycleList: [],
+					aridRegionList: []
 				},
 				},
 
 
 
 
@@ -107,6 +110,8 @@
 			uni.$on("setSelectList", (selectList, id) => {
 			uni.$on("setSelectList", (selectList, id) => {
 			
 			
 			    let turnover = []
 			    let turnover = []
+				let aridRegionList = []
+				
 
 
 				selectList.forEach(f => {
 				selectList.forEach(f => {
 					if (f.rootCategoryLevelId == 7) { // 周转车
 					if (f.rootCategoryLevelId == 7) { // 周转车
@@ -114,9 +119,15 @@
 					}
 					}
 				})
 				})
 				
 				
-			
+				selectList.forEach(f => {
+					if (f.rootCategoryLevelId == 11) { // 干燥区
+				  	aridRegionList = aridRegionList.concat(f)
+					}
+				})
+				
+				
 				this.$set(this.objData, 'turnover', turnover)
 				this.$set(this.objData, 'turnover', turnover)
-				console.log(this.objData)
+				this.$set(this.objData, 'aridRegionList', aridRegionList)
 				this.$forceUpdate()
 				this.$forceUpdate()
 				
 				
 				
 				
@@ -130,7 +141,10 @@
 
 
 			// 相机扫码
 			// 相机扫码
 			HandlScanCode() {
 			HandlScanCode() {
-				this.scanItAllData('w0300000003140004')
+				// CX-EQ-YLSJL-008	  设备
+				// M001 M002 模具 
+				// 周转车 w0300000003140004
+				this.scanItAllData('M002')
 				return false
 				return false
 
 
 				let _this = this
 				let _this = this
@@ -144,8 +158,35 @@
 
 
 			scanItAllData(result) {
 			scanItAllData(result) {
 				scanLedger(result).then(res => {
 				scanLedger(result).then(res => {
+					if (res.length == 1 && res[0].rootCategoryLevelId == 4) { // 设备
+					     if(this.objData.equipmentList.length == 0) {
+							 this.objData.equipmentList = res
+							 	this.$forceUpdate()
+						 } else {
+							 if(this.objData.equipmentList[0].instanceId != res[0].instanceId) {
+								 uni.showToast({
+								 	title: '设备不匹配',
+								 	icon: 'none'
+								 })
+							 }
+						 }
+					} 
+					
+					if (res.length >= 1 && res[0].rootCategoryLevelId == 5) { // 磨具
+					     if(this.objData.modelList.length == 0) {
+							 this.objData.modelList = res
+							 	this.$forceUpdate()
+						 } else {
+							 if(this.objData.modelList[0].instanceId != res[0].instanceId) {
+								 uni.showToast({
+								 	title: '模具不匹配',
+								 	icon: 'none'
+								 })
+							 }
+						 }
+					} 
 					
 					
-					if (res.length == 1 && res[0].rootCategoryLevelId == 7) { // 周转车
+					else if (res.length == 1 && res[0].rootCategoryLevelId == 7) { // 周转车
 
 
 						let isFals = this.objData.turnover.some(m => m.code == result)
 						let isFals = this.objData.turnover.some(m => m.code == result)
 						if (isFals) {
 						if (isFals) {
@@ -168,6 +209,11 @@
 					this.objData.turnover.splice(idx, 1)
 					this.objData.turnover.splice(idx, 1)
 					this.$forceUpdate()
 					this.$forceUpdate()
 				}
 				}
+				
+				if (type == 'aridRegion') {
+					this.objData.aridRegionList.splice(idx, 1)
+					this.$forceUpdate()
+				}
 			},
 			},
 
 
 			handleScan(id, type) {
 			handleScan(id, type) {
@@ -190,6 +236,9 @@
 						if (!this.objData.hasOwnProperty('turnover')) {
 						if (!this.objData.hasOwnProperty('turnover')) {
 							this.objData['turnover'] = []
 							this.objData['turnover'] = []
 						}
 						}
+						if (!this.objData.hasOwnProperty('aridRegionList')) {
+							this.objData['aridRegionList'] = []
+						}
 
 
 					})
 					})
 				} else if (type == 'turnover') {
 				} else if (type == 'turnover') {
@@ -219,6 +268,9 @@
 					if (!this.objData.hasOwnProperty('turnover')) {
 					if (!this.objData.hasOwnProperty('turnover')) {
 						this.objData['turnover'] = []
 						this.objData['turnover'] = []
 					}
 					}
+					if (!this.objData.hasOwnProperty('aridRegionList')) {
+						this.objData['aridRegionList'] = []
+					}
 					console.log(this.objData)
 					console.log(this.objData)
 				})
 				})
 			},
 			},

+ 56 - 20
pages/pda/workOrder/search/index.vue

@@ -47,7 +47,7 @@
 									{{ itm.label }}:{{ item[itm.prop] }}
 									{{ itm.label }}:{{ item[itm.prop] }}
 								</view>
 								</view>
 
 
-								<view class="items">
+								<view class="items" v-if='item.rootCategoryLevelId != 11'>
 									可用库存:{{ item.availableCountBase }} {{item.unit}}
 									可用库存:{{ item.availableCountBase }} {{item.unit}}
 								</view>
 								</view>
 
 
@@ -117,6 +117,7 @@
 			return {
 			return {
 
 
 				keyWord: null,
 				keyWord: null,
+				rootCategoryLevelId: null,
 				categoryLevelId: null,
 				categoryLevelId: null,
 				classificationList: [],
 				classificationList: [],
 				treePickerShow: false,
 				treePickerShow: false,
@@ -149,8 +150,8 @@
 			this.isType = option.isType
 			this.isType = option.isType
 			if (option.storageKey) {
 			if (option.storageKey) {
 				this.storageKey = option.storageKey
 				this.storageKey = option.storageKey
-                  
-				  this.memoList = []
+
+				this.memoList = []
 
 
 				if (this.isType == 'feed') {
 				if (this.isType == 'feed') {
 					let _arr = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
 					let _arr = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
@@ -162,8 +163,8 @@
 					this.memoList = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
 					this.memoList = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
 				} else if (this.isType == 'job') {
 				} else if (this.isType == 'job') {
 					let _obj = (this.storageKey && uni.getStorageSync(this.storageKey)) || {}
 					let _obj = (this.storageKey && uni.getStorageSync(this.storageKey)) || {}
-					this.memoList = [..._obj.turnover]
-					
+					this.memoList = [..._obj.turnover, ..._obj.aridRegionList]
+
 				}
 				}
 
 
 
 
@@ -232,11 +233,13 @@
 
 
 				treeByPid(params).then(res => {
 				treeByPid(params).then(res => {
 					this.classificationList = res
 					this.classificationList = res
-					this.confirm([res[0].id], res[0].name)
+					this.confirm([res[0].id], res[0].name, res[0].rootCategoryLevelId)
 				})
 				})
 			},
 			},
 
 
-			confirm(id, name) {
+			confirm(id, name, rootCategoryLevelId) {
+
+				this.rootCategoryLevelId = rootCategoryLevelId
 				this.categoryLevelId = id
 				this.categoryLevelId = id
 
 
 				this.list = []
 				this.list = []
@@ -263,6 +266,10 @@
 					size: 100,
 					size: 100,
 
 
 				}
 				}
+
+				if (this.rootCategoryLevelId == '11') { // 干燥区特殊处理
+					param.size = 5
+				}
 				isEnd = false
 				isEnd = false
 				let URL = null
 				let URL = null
 				if (this.isType == 'pick') { // 领料
 				if (this.isType == 'pick') { // 领料
@@ -275,21 +282,50 @@
 				}
 				}
 
 
 				URL(param).then(res => {
 				URL(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,
+					if (this.rootCategoryLevelId == '11') {
+
+						res.list.forEach(e => {
+							if (e.extInfo?.positionList && e.extInfo?.positionList.length != 0) {
+								e.extInfo.positionList.map(i => {
+									const checked =
+										this.memoList.findIndex(itm => itm.id === i.id) > -1
+
+									let obj = {
+										checked,
+										name: e.name,
+										region: e.extInfo.region,
+										rootCategoryLevelId: e.rootCategoryLevelId,
+										...i,
+										instanceId: i.id,
+
+									}
+									this.list.push(obj)
+
+								})
 							}
 							}
 						})
 						})
-					)
+
+
+						console.log(this.list)
+
+					} else {
+						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,
+								}
+							})
+						)
+					}
+
 
 
 					isEnd = this.list.length >= res.count
 					isEnd = this.list.length >= res.count