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

+ 16 - 19
pages/pda/feeding/components/feedBom.js

@@ -14,31 +14,28 @@ export const tableHeader = selectEquiType => {
 			]
 		case 5:
 			return [{
-					label: '牌号',
-					prop: 'brandNum'
-				},
-				{
-					label: '型号',
-					prop: 'modelType'
-				},
-				{
-					label: '模孔数量',
-					prop: ''
+					label: '',
+					prop: ['name', 'code'],
+					write: false,
+					extInfo: false
 				},
 
 				{
-					label: '芯棒直径',
-					prop: ''
+					label: '冲压次数',
+					prop: 'cyTimes',
+					write: false,
+					extInfo: true
 				},
+				
 				{
-					label: '收缩系数',
-					prop: '',
-					formatter(row) {
-						if (!row?.extendField) return ''
-						const extendField = JSON.parse(row.extendField)
-						return extendField.shrinkageCoefficient
-					}
+					label: '最大冲压次数',
+					prop: 'maxCyTimes',
+					write: false,
+					extInfo: true
 				},
+
+
+
 			]
 
 

+ 22 - 0
pages/pda/feeding/components/instance.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 50 - 14
pages/pda/feeding/components/modelBom.vue

@@ -12,28 +12,41 @@
 
 		<view class="material ">
 
-			<view class="content_table" v-for="(item,index) in list" :key='index'>
+			<view class="content_table">
 				<view class="item">
-					<view class="lable rx-cc">设备编码</view>
+					<view class="lable rx-cc">模具编号</view>
 					<view class="content">
-						{{item.code}}
+						{{ list[0] && list[0].codeNumber }}
 					</view>
 				</view>
 
-				<view class="item">
-					<view class="lable rx-cc">设备名称</view>
-					<view class="content">{{ item.name }}</view>
-				</view>
+			</view>
+
+			<view class="content_table" v-for="(item,index) in list" :key='index'>
+				<view class="item " v-for="(tab, tIdx) in tableH(5)" :key="tIdx">
+					<view class="item " v-if="Array.isArray(tab.prop)">
+						<view class="lable lable300 rx-sc"> {{ item[tab.prop[0]]  }}</view>
+						<view class="content">
+							{{ item[tab.prop[1]]  }}
+						</view>
+					</view>
 
-				<view class="item">
-					<view class="lable rx-cc">固资编码</view>
-					<view class="content">{{ item.fixCode }}</view>
-				</view>
 
-	
+					<view class="item" v-if="!Array.isArray(tab.prop)">
+						<view class="lable lable300 rx-sc"> {{ tab.label  }}</view>
+						<view class="content content_num" v-if='tab.write'>
+							<input class="uni-input" v-model="tab.extInfo ?  item.extInfo[0][tab.prop]: item[tab.prop]"
+								type="digit"></input>
+						</view>
+						<view class="content" v-if='!tab.write'>
+							
+							{{tab.extInfo ?  item.extInfo[0][tab.prop] : item[tab.prop]}}
+						</view>
+					</view>
 
 
 
+				</view>
 
 			</view>
 		</view>
@@ -43,6 +56,9 @@
 </template>
 
 <script>
+	import {
+		tableHeader
+	} from './feedBom.js'
 	export default {
 		props: {
 			workOrderId: {
@@ -60,6 +76,10 @@
 			}
 		},
 		methods: {
+			tableH(type) {
+				return tableHeader(type)
+			},
+
 			handleScan(id) {
 				this.$emit('scanIt', id, )
 			},
@@ -70,6 +90,7 @@
 <style lang="scss" scoped>
 	.title_box {
 		margin-top: 20rpx;
+
 		.name {
 			font-size: 28rpx;
 			font-style: normal;
@@ -125,10 +146,10 @@
 		.content_table {
 			width: 100%;
 			border: 2rpx solid $border-color;
-            margin-bottom: 10rpx;
+
 			.item {
 				display: flex;
-				border-bottom: 2rpx solid $border-color;
+				border-bottom: 1rpx dotted $border-color;
 
 
 				.lable {
@@ -145,6 +166,14 @@
 					font-size: 24rpx;
 				}
 
+
+				.lable300 {
+					width: 300rpx !important;
+					padding-left: 14rpx;
+					font-size: 24rpx;
+				}
+
+
 				.ww80 {
 					width: 80rpx;
 				}
@@ -195,6 +224,11 @@
 				}
 			}
 
+
+			.bot_border {
+				border-bottom: 2rpx solid $theme-color;
+			}
+
 			.ww55 {
 				width: 55%;
 			}
@@ -203,5 +237,7 @@
 				width: 45%;
 			}
 		}
+
+
 	}
 </style>

+ 34 - 25
pages/pda/feeding/details.vue

@@ -8,12 +8,13 @@
 				<view v-for="(item,index) in List" :key="index" class="card_box">
 					<workOrderBom :item='item' @handleScan='handleScan'></workOrderBom>
 
-					<deviceBom v-if='item.equipmentList.length != 0' :workOrderId='item.workOrderId' :list='item.equipmentList'
-						@scanIt='scanIt'></deviceBom>
-						
-					<modelBom v-if='item.modelList.length != 0' :workOrderId='item.workOrderId' :list='item.modelList'></modelBom>	
-						
-						
+					<deviceBom v-if='item.equipmentList.length != 0' :workOrderId='item.workOrderId'
+						:list='item.equipmentList' @scanIt='scanIt'></deviceBom>
+
+					<modelBom v-if='item.modelList.length != 0' :workOrderId='item.workOrderId' :list='item.modelList' @scanIt='scanIt'>
+					</modelBom>
+
+
 					<view class="operate_box rx-sc">
 						<u-button size="small" class="u-reset-button" type="success"
 							@click="handAdd(item.workOrderId)">手动添加</u-button>
@@ -49,6 +50,8 @@
 		batchSave
 	} from '@/api/pda/picking.js'
 
+
+
 	export default {
 		components: {
 			workOrderBom,
@@ -70,8 +73,6 @@
 			this.idsList = JSON.parse(queryArray);
 
 
-
-
 			this.getList()
 
 		},
@@ -177,22 +178,26 @@
 
 			},
 			scanIt(id) {
-				console.log(id)
-
+		         console.log(id)
+                 
+				 // CX-EQ-YLSJL-008	  设备
+				 // M001 模具 
 				this.scanItData('M001', id)
 				return false
 
-				// let _this = this
-				// uni.scanCode({
-				// 	success: function(res) {
-				// 		_this.scanItData(res.result, id)
-				// 	}
-				// })
+				let _this = this
+				uni.scanCode({
+					success: function(res) {
+						_this.scanItData(res.result, id)
+						console.log(res.result, id)
+					}
+				})
 			},
 
 			scanItData(result, id) {
 				scanLedger(result).then(res => {
-					 let _arr = []
+					console.log(res)
+					let _arr = []
 					if (res.length == 1 && res[0].rootCategoryLevelId == 4) { // 设备
 						_arr = this.List
 						_arr.forEach((e, index) => {
@@ -201,17 +206,21 @@
 							}
 						})
 						this.List = _arr
+						this.$forceUpdate()
 
 					} else if (res.length >= 1 && res[0].rootCategoryLevelId == 5) {
-                         _arr = this.List
-                         _arr.forEach((e, index) => {
-                         	if (e.workOrderId == id) {
-                         		_arr[index].modelList = res
-                         	}
-                         })
-                         this.List = _arr
+						_arr = this.List
+						_arr.forEach((e, index) => {
+							if (e.workOrderId == id) {
+								_arr[index].modelList = res
+							}
+						})
+						this.List = _arr
+						this.$forceUpdate()
+					
 					}
 				})
+				
 			},
 
 			handAdd(id, list) {
@@ -275,7 +284,7 @@
 		padding: 10rpx 160rpx;
 
 		/deep/ .u-button {
-			width: 140rpx;
+			width: 160rpx;
 		}
 	}
 </style>