ysy 2 anos atrás
pai
commit
fe8f25e0b1

+ 14 - 0
api/pda/feeding.js

@@ -0,0 +1,14 @@
+import { postJ, post, get } from "@/utils/request";
+import Vue from "vue";
+
+
+// 投料保存
+export async function batchSave(params) {
+  const data = await postJ(
+   Vue.prototype.apiUrl  + `/pda/mes/feed/batchSave`, params, true,
+  );
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}

+ 4 - 4
pages/pda/feeding/components/feedBom.js

@@ -4,17 +4,17 @@ export const tableHeader = selectEquiType => {
 	switch (+selectEquiType) {
 		case 1:
 			return [
-				
+
 				{
 					label: '编码',
 					prop: 'code'
 				},
-				
+
 				{
 					label: '名称',
 					prop: 'name'
 				},
-				
+
 				{
 					label: '型号',
 					prop: 'modelType'
@@ -42,7 +42,7 @@ export const tableHeader = selectEquiType => {
 					write: false,
 					extInfo: true
 				},
-				
+
 				{
 					label: '最大冲压次数',
 					prop: 'maxCyTimes',

+ 2 - 2
pages/pda/feeding/components/modelBom.vue

@@ -35,12 +35,12 @@
 					<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]"
+							<input class="uni-input" v-model="tab.extInfo ?  item.extInfo[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]}}
+							{{tab.extInfo ?  item.extInfo[tab.prop] : item[tab.prop]}}
 						</view>
 					</view>
 

+ 1 - 1
pages/pda/feeding/components/workOrderBom.vue

@@ -32,7 +32,7 @@
 
 				<view class="item rx-sc">
 					<view class="rx ww55 ">
-						<view class="lable lable150 rx-cc">要求成型数量</view>
+						<view class="lable  rx-cc">生产数量</view>
 						<view class="content rx-sc">
 							<view>{{item.formingNum}}</view>
 							<view class="unit">{{item.unit}}</view>

+ 84 - 22
pages/pda/feeding/details.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content-box">
 		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
-			color="#000" @clickLeft="back"></uni-nav-bar>
+			color="#000" @clickLeft="back" right-icon="scan" @clickRight="handlScanCode"></uni-nav-bar>
 
 		<view class="list_box">
 			<u-list @scrolltolower="scrolltolower">
@@ -11,10 +11,12 @@
 					<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 v-if='item.modelList.length != 0' :workOrderId='item.workOrderId' :list='item.modelList'
+						@scanIt='scanIt'>
 					</modelBom>
-					
-					<instanceBom v-if='item.instanceList.length != 0' :workOrderId='item.workOrderId' :list='item.instanceList'></instanceBom>
+
+					<instanceBom v-if='item.instanceList.length != 0' :workOrderId='item.workOrderId'
+						:list='item.instanceList'></instanceBom>
 
 
 					<view class="operate_box rx-sc">
@@ -51,7 +53,7 @@
 
 	import {
 		batchSave
-	} from '@/api/pda/picking.js'
+	} from '@/api/pda/feeding.js'
 
 
 
@@ -104,15 +106,20 @@
 			save() {
 				let _arr = []
 				_arr = this.List.map(m => {
+
 					return {
 						...m
 					}
+
 				})
 
+                 
+				 console.log(_arr)
+
 				batchSave(_arr).then(res => {
 
 					uni.navigateTo({
-						url: `/pages/pda/picking/index/index?pickStatus=1`,
+						url: `/pages/pda/feeding/index/index?feedStatus=1`,
 					});
 
 				})
@@ -182,12 +189,12 @@
 
 			},
 			scanIt(id) {
-		         console.log(id)
-                 
-				 // CX-EQ-YLSJL-008	  设备
-				 // M001 M002 模具 
-				 //  W31000055273 物料
-				this.scanItData('W31000055273', id)
+				console.log(id)
+
+				// CX-EQ-YLSJL-008	  设备
+				// M001 M002 模具 
+				//  S310000552731 物料
+				this.scanItData('M002', id)
 				return false
 
 				let _this = this
@@ -201,7 +208,7 @@
 
 			scanItData(result, id) {
 				scanLedger(result).then(res => {
-			
+
 					let _arr = []
 					if (res.length == 1 && res[0].rootCategoryLevelId == 4) { // 设备
 						_arr = this.List
@@ -214,7 +221,7 @@
 						this.$forceUpdate()
 
 					} else if (res.length >= 1 && res[0].rootCategoryLevelId == 5) { // 模具
-				
+
 						_arr = this.List
 						_arr.forEach((e, index) => {
 							if (e.workOrderId == id) {
@@ -223,11 +230,9 @@
 						})
 						this.List = _arr
 						this.$forceUpdate()
-					
-					} 
-					
-					else if(res.length >= 1 && ['1'].includes(res[0].rootCategoryLevelId)) {
-			
+
+					} else if (res.length >= 1 && ['1'].includes(res[0].rootCategoryLevelId)) {
+
 						_arr = this.List
 						_arr.forEach((e, index) => {
 							if (e.workOrderId == id) {
@@ -235,13 +240,70 @@
 							}
 						})
 						this.List = _arr
-			
+
 						this.$forceUpdate()
-						
+
 					}
-					
+
 				})
+
+			},
+			
+			// 全部扫一扫
+			handlScanCode() {
+				
+				
+				// CX-EQ-YLSJL-008	  设备
+				// M001 M002 模具 
+				//  S310000552731 物料
+				this.scanItAllData('M001')
+				return false
 				
+				let _this = this
+				uni.scanCode({
+					success: function(res) {
+						_this.scanItAllData(res.result)
+			
+					}
+				})
+			},
+			
+			
+			scanItAllData(result) {
+				scanLedger(result).then(res => {
+			
+					let _arr = []
+					if (res.length == 1 && res[0].rootCategoryLevelId == 4) { // 设备
+						_arr = this.List
+						_arr.forEach((e, index) => {
+						        e.equipmentList = res
+						})
+						this.List = _arr
+						this.$forceUpdate()
+			
+					} else if (res.length >= 1 && res[0].rootCategoryLevelId == 5) { // 模具
+			
+						_arr = this.List
+						_arr.forEach((e, index) => {
+						e.modelList = res
+						})
+						this.List = _arr
+						this.$forceUpdate()
+			
+					} else if (res.length >= 1 && ['1'].includes(res[0].rootCategoryLevelId)) {
+			
+						_arr = this.List
+						_arr.forEach((e, index) => {
+						   e.instanceList = e.instanceList.concat(res)
+						})
+						this.List = _arr
+			
+						this.$forceUpdate()
+			
+					}
+			
+				})
+			
 			},
 
 			handAdd(id, list) {