ysy 2 yıl önce
ebeveyn
işleme
0ab3105822
1 değiştirilmiş dosya ile 29 ekleme ve 14 silme
  1. 29 14
      pages/pda/turnover/index/quality.vue

+ 29 - 14
pages/pda/turnover/index/quality.vue

@@ -11,8 +11,8 @@
 
 
 
-					<qualityTurnoverBom v-if='objData.turnover && objData.turnover.length != 0' :list='objData.turnover' :wordItem='objData'
-						:newTurnover='objData.newTurnover' @handleScan='handleScan' @refreshList='getList'>
+					<qualityTurnoverBom v-if='objData.turnover && objData.turnover.length != 0' :list='objData.turnover'
+						:wordItem='objData' :newTurnover='objData.newTurnover' @refreshList='getList'>
 					</qualityTurnoverBom>
 
 
@@ -20,9 +20,9 @@
 
 					<view class="operate_box rx-sc">
 						<u-button size="small" class="u-reset-button" type="success"
-							@click="handAdd(objData.workOrderId)">手动添加</u-button>
+							@click="handAdd(objData.id)">手动添加</u-button>
 						<u-button size="small" class="u-reset-button" type="success"
-							@click="scanIt(objData.workOrderId)">扫一扫</u-button>
+							@click="scanIt(objData.id)">扫一扫</u-button>
 					</view>
 
 				</view>
@@ -42,6 +42,7 @@
 
 	import {
 		getVehicle,
+		scanLedger
 	} from '@/api/pda/workOrder.js'
 
 
@@ -70,12 +71,12 @@
 				let turnover = []
 				selectList.forEach(f => {
 					if (f.rootCategoryLevelId == 7) { // 周转车
-					
-					f.extInfo.positionList.length && f.extInfo.positionList.forEach(o => {
-						o['check'] = false
-						o['isend'] = false
-					})
-					
+
+						f.extInfo.positionList.length && f.extInfo.positionList.forEach(o => {
+							o['check'] = false
+							o['isend'] = false
+						})
+
 						turnover = turnover.concat(f)
 					}
 				})
@@ -114,7 +115,6 @@
 						res['turnover'] = []
 					}
 					this.objData = res
-					console.log(this.objData)
 
 				})
 			},
@@ -134,19 +134,34 @@
 			},
 
 
-			handleScan(id, type) {
-
+			scanIt(id) {
+				console.log(id)
 				let _this = this
+					_this.scanItData('w0300000002579001', id)
+				return false
 				uni.scanCode({
 					success: function(res) {
-						_this.scanData(res.result, type, id)
+						_this.scanItData(res.result, id)
 					}
 				})
+			},
+
 
+			scanItData(result, id) {
+				scanLedger(result).then(res => {
+					let _arr = []
+					if (res.length == 1 && res[0].rootCategoryLevelId == 7) { // 设备
+						this.objData.turnover = res
+						this.$forceUpdate()
+
+					}
+
+				})
 
 			},
 
 
+
 			handAdd(id) {
 				const storageKey = Date.now() + "";
 				uni.setStorageSync(storageKey, this.objData);