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

+ 16 - 0
api/pda/workOrder.js

@@ -111,3 +111,19 @@ export async function  getByCode(code) {
   }
   return Promise.reject(data.message);
 }
+
+// 扫码 获取台账
+
+export async function  scanLedger(code) {
+  const data = await get(
+   Vue.prototype.apiUrl  + `/main/asset/getByCode/${code}`
+  );
+
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}
+
+
+

+ 13 - 9
pages/pda/feeding/components/deviceBom.vue

@@ -3,7 +3,7 @@
 		<view class="title_box rx-bc">
 			<view class="name">设备信息</view>
 
-			<view class="btn_box rx-bc" @click="handleScan(item.workOrderId)">
+			<view class="btn_box rx-bc" @click="handleScan(workOrderId)">
 				<image class="scan" src="@/static/pda/ScanIt.svg"></image>
 				更换设备
 			</view>
@@ -12,7 +12,7 @@
 
 		<view class="material ">
 
-			<view class="content_table">
+			<view class="content_table" v-for="(item,index) in list" :key='index'>
 				<view class="item">
 					<view class="lable rx-cc">设备编码</view>
 					<view class="content">
@@ -22,12 +22,12 @@
 
 				<view class="item">
 					<view class="lable rx-cc">设备名称</view>
-					<view class="content">{{ item.productCode }}</view>
+					<view class="content">{{ item.name }}</view>
 				</view>
 
 				<view class="item">
 					<view class="lable rx-cc">固资编码</view>
-					<view class="content">{{ item.produceRoutingName }}</view>
+					<view class="content">{{ item.fixCode }}</view>
 				</view>
 
 	
@@ -45,9 +45,13 @@
 <script>
 	export default {
 		props: {
-			item: {
-				type: Object,
-				default: () => {}
+			workOrderId: {
+				type: String,
+				default: ''
+			},
+			list: {
+				type: Array,
+				default: () => []
 			},
 		},
 		data() {
@@ -57,7 +61,7 @@
 		},
 		methods: {
 			handleScan(id) {
-				this.$emit('handleScan', id, 'device')
+				this.$emit('scanIt', id, )
 			},
 		}
 	}
@@ -121,7 +125,7 @@
 		.content_table {
 			width: 100%;
 			border: 2rpx solid $border-color;
-
+            margin-bottom: 10rpx;
 			.item {
 				display: flex;
 				border-bottom: 2rpx solid $border-color;

+ 5 - 5
pages/pda/feeding/components/feedCard.vue

@@ -3,14 +3,14 @@
 
 		<checkbox-group v-for="(item, index) in list" :key="index" @change="e => selectVal(e, item, index)">
 		     <label>
-			<view class="card_box" @click="openDetails(item.pickStatus, item.id)">
+			<view class="card_box" @click="openDetails(item.feedStatus, item.id)">
 				<view class="item_box rx-bc">
 					<view class="rx-sc">
-						<checkbox  v-if='item.pickStatus == 0' :checked="item.checked" />
+						<checkbox  v-if='item.feedStatus == 0' :checked="item.checked" />
 							
 						<view class="orderId">{{item.code}} </view>
 					</view>
-					<view class="status " :class="[item.pickStatus == 0 ? 'FAA': '' ]"> {{ item.pickStatus == 0 ? '未领料' : item.pickStatus == 1 ? '已领料' : item.pickStatus == 2 ? '已出库' : '' }}</view>
+					<view class="status " :class="[item.feedStatus == 0 ? 'FAA': '' ]"> {{ item.feedStatus == 0 ? '未投料' : item.feedStatus == 1 ? '已投料' : ''}}</view>
 				</view>
 
 				<view class="item_box rx-bc">
@@ -92,8 +92,8 @@
 				this.list[index].checked = !this.list[index].checked
 			},
 			
-			openDetails(pickStatus, id) {
-				if(pickStatus == 1) {
+			openDetails(feedStatus, id) {
+				if(feedStatus == 1) {
 					 let url =  `/pages/pda/picking/bill/index?id=${id}`
 					uni.navigateTo({
 						url

+ 54 - 24
pages/pda/feeding/details.vue

@@ -5,15 +5,12 @@
 
 		<view class="list_box">
 			<u-list @scrolltolower="scrolltolower">
-
 				<view v-for="(item,index) in List" :key="index" class="card_box">
 					<workOrderBom :item='item' @handleScan='handleScan'></workOrderBom>
-					
-					<deviceBom :item='item'></deviceBom>
-					
+					<deviceBom :item.workOrderId='item.workOrderId' :list='item.device' @scanIt='scanIt'></deviceBom>
 						<view class="operate_box rx-sc">
-							<u-button size="small" class="u-reset-button" type="success" >手动添加</u-button>
-							<u-button size="small" class="u-reset-button" type="success" >扫一扫</u-button>
+							<u-button size="small" class="u-reset-button" type="success" @click="handAdd(item.workOrderId)" >手动添加</u-button>
+							<u-button size="small" class="u-reset-button" type="success" @click="scanIt(item.workOrderId)">扫一扫</u-button>
 						</view>
 				</view>
 			</u-list>
@@ -35,7 +32,8 @@
 	import deviceBom from './components/deviceBom.vue'
 	import {
 		workorderList,
-		getByCode
+		getByCode,
+		scanLedger
 	} from '@/api/pda/workOrder.js'
 
 	import {
@@ -109,6 +107,7 @@
 				workorderList(this.idsList).then(res => {
 					this.List = res.map(m => {
 						m.workOrderId = m.id
+						m.device = []
 						delete m.id
 						return {
 							...m
@@ -119,33 +118,26 @@
 
 
 
-			addPicking(id, list) {
-				const storageKey = Date.now() + "";
-				uni.setStorageSync(storageKey, list || []);
-				uni.navigateTo({
-					url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}`
-				})
-			},
+		
 
 			handleScan(id, type) {
 				console.log(id)
 				console.log(type)
 
-				// this.scanData('SCJHGD20240117002', type, id)
-				// return false
+				this.scanData('SCJHGD2024011700222', type, id)
+				return false
 
-				let _this = this
-				uni.scanCode({
-					success: function(res) {
-						_this.scanData(res.result, type, id)
-					}
-				})
+				// let _this = this
+				// uni.scanCode({
+				// 	success: function(res) {
+				// 		_this.scanData(res.result, type, id)
+				// 	}
+				// })
 
 
 			},
 
 			scanData(result, type, id) {
-
 				if (type == 'wordOrder') {
 					let isFals = this.List.some(m => m.code == result)
 					if (isFals) {
@@ -171,7 +163,45 @@
 						})
 					}
 
-				}
+				},
+				scanIt(id) {
+					console.log(id)
+					
+					this.scanItData('CX-EQ-YLSJL-016', id)
+					return false
+					
+					let _this = this
+					uni.scanCode({
+						success: function(res) {
+							_this.scanItData(res.result, id)
+						}
+					})
+				},
+				
+				scanItData(result,id) {
+					scanLedger(result).then(res => {
+						console.log(res)
+							let _arr = []
+						if(res.rootCategoryLevelId == 4) { // 设备
+						_arr = this.List
+							_arr.forEach((e, index) => {
+								if (e.workOrderId == id) {
+									_arr[index].device = [res]
+								}
+							})
+							this.List = _arr
+							console.log(this.List)
+						}
+					})
+				},
+				
+				handAdd(id, list) {
+					const storageKey = Date.now() + "";
+					uni.setStorageSync(storageKey, list || []);
+					uni.navigateTo({
+						url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}`
+					})
+				},
 
 			},
 

+ 8 - 8
pages/pda/feeding/index/index.vue

@@ -11,9 +11,9 @@
 			</view> -->
 
 			<view class="nav_box rx-sc">
-				<view class="nav_item " :class="{active: pickStatus == 0}" @click="handNav(0)">
+				<view class="nav_item " :class="{active: feedStatus == 0}" @click="handNav(0)">
 					未投料({{navObj.unclaimedQuantity}})</view>
-				<view class="nav_item" :class="{active: pickStatus == 1}" @click="handNav(1)">
+				<view class="nav_item" :class="{active: feedStatus == 1}" @click="handNav(1)">
 					已投料({{navObj.claimedQuantity}})</view>
 				
 
@@ -43,7 +43,7 @@
 
 		</view>
 
-		<view class="bottom-wrapper rx-bc" v-if='pickStatus == 0'>
+		<view class="bottom-wrapper rx-bc" v-if='feedStatus == 0'>
 			<view>
 				<checkbox v-if="!seletedAll" color="#fff" :checked="seletedAll" @tap="_seletedAll">全选</checkbox>
 				<checkbox class="select-all" color="#fff" v-else :checked="seletedAll" @tap="_seletedAll">取消全选
@@ -128,7 +128,7 @@
 		data() {
 			return {
 				tabType: 1,
-				pickStatus: 0,
+				feedStatus: 0,
 				
 				formData: {
 					produceRoutingId: ''
@@ -162,7 +162,7 @@
 		},
 
 		onLoad(option) {
-			this.pickStatus = option.pickStatus || 0
+			this.feedStatus = option.feedStatus || 0
 			
 			this.produceFn()
 		},
@@ -188,7 +188,7 @@
 				let params = {
 					pageNum: this.page,
 					size: this.size,
-					pickStatus: this.pickStatus,
+					feedStatus: this.feedStatus,
 					produceRoutingId: this.formData.produceRoutingId
 
 				}
@@ -227,8 +227,8 @@
 			},
 
 			handNav(type) {
-				if (type != this.pickStatus) {
-					this.pickStatus = type
+				if (type != this.feedStatus) {
+					this.feedStatus = type
 
 					this.page = 1
 					this.dataList = []