ysy 1 年之前
父节点
当前提交
938334a5a6
共有 3 个文件被更改,包括 68 次插入14 次删除
  1. 9 4
      pages/pda/feeding/components/workOrderBom.vue
  2. 47 6
      pages/pda/feeding/details.vue
  3. 12 4
      pages/pda/jobBooking/index/index.vue

+ 9 - 4
pages/pda/feeding/components/workOrderBom.vue

@@ -8,8 +8,8 @@
 				更换工单
 			</view>
 		</view>
-
-
+              
+           
 		<view class="material ">
 
 			<view class="content_table">
@@ -64,11 +64,11 @@
 
 
 
-		<view class="title_box mt20 rx-bc" v-if="clientEnvironmentId == 3 && (pType == 'feed' || pType == 'job')">
+		<view class="title_box mt20 rx-bc" v-if="clientEnvironmentId == 3 && taskType == 1 && (pType == 'feed' || pType == 'job')">
 			<view class="name">{{ pType == 'feed' ? '实际投料时间' : '实际报工时间'}} </view>
 		</view>
 
-		<view class="material " v-if="clientEnvironmentId == 3 && (pType == 'feed' || pType == 'job')">
+		<view class="material " v-if="clientEnvironmentId == 3 && taskType == 1  && (pType == 'feed' || pType == 'job')">
 
 			<view class="content_table">
 				<view class="item">
@@ -100,6 +100,11 @@
 			pType: {
 				type: '',
 				default: ''
+			},
+			
+			taskType: {
+				type: '',
+				default: ''
 			}
 
 		},

+ 47 - 6
pages/pda/feeding/details.vue

@@ -6,7 +6,8 @@
 		<view class="list_box">
 			<u-list @scrolltolower="scrolltolower">
 				<view v-for="(item,index) in List" :key="index" class="card_box">
-					<workOrderBom :item='item' pType="feed" @handleScan='handleScan'></workOrderBom>
+				
+					<workOrderBom :item='item' pType="feed" :taskType="item.currentTaskDiagram.type" @handleScan='handleScan'></workOrderBom>
 
 
 					<paramBom v-if='item.paramDetailList.length != 0' :list='item.paramDetailList'></paramBom>
@@ -257,8 +258,14 @@
 					return false
 				}
 
-               if(this.clientEnvironmentId == 3) {
+               if(this.clientEnvironmentId == 3 && this.List[0].currentTaskDiagram.type == 1) {
 				   if(this.List[0] && this.List[0].executorTime && this.List[0].executorTime != undefined ) {
+					  // 正则表达式1:匹配 yyyy-MM-dd 格式
+					    let dateRegex = /^\d{4}-\d{2}-\d{2}$/;
+					  	if(dateRegex.test(this.List[0].executorTime.trimRight())) {
+					  		this.List[0].executorTime = this.List[0].executorTime+' 00:00:00'
+					  	}					
+												 
 				   } else {
 					   uni.showToast({
 					   	title: `请先选择时间投料时间`,
@@ -268,8 +275,15 @@
 					    return false
 				   }
 			   }
-               
-			 
+			   
+			   
+			   
+			 const isDevice = await this.checkdDevice()
+			 if (!isDevice) {
+			 	return false
+			 } 
+			   
+                console.log('投料', this.List)
 				batchSave(this.List).then(res => {
 
 					uni.redirectTo({
@@ -672,8 +686,6 @@
 			},
 
 
-
-
 			openDetails(id) {
 				const storageKey = Date.now() + "";
 				uni.setStorageSync(storageKey, this.List || []);
@@ -682,6 +694,35 @@
 					url
 				})
 			},
+			
+			
+			checkdDevice() {
+				return new Promise((resolve) => {
+		          console.log(this.List)
+				    let isFalse = this.List.every(item => {
+						return item.equipmentList && item.equipmentList.length > 0
+					})
+				     if(isFalse) {
+						resolve(true)
+						} else {
+					
+							uni.showModal({
+							title: '提示',
+							content: '没有选择设备,是否继续?',
+							confirmText: '确认', //这块是确定按钮的文字
+							success: function(res) {
+								if (res.confirm) {
+									resolve(true)
+								} else {
+									resolve(false)
+								}
+							}
+						})
+						
+					 }
+				
+				})
+			},
 
 		},
 

+ 12 - 4
pages/pda/jobBooking/index/index.vue

@@ -9,7 +9,7 @@
 
 				<view class="card_box">
 
-					<workOrderBom :item='objData' pType="job" v-if='objData' @handleScan='handleScan'></workOrderBom>
+					<workOrderBom :item='objData' pType="job" v-if='objData' :taskType="taskType" @handleScan='handleScan'></workOrderBom>
 
 					<paramBom v-if='paramDetailList.length != 0' :list='paramDetailList'></paramBom>
 
@@ -775,10 +775,18 @@
 					this.objData.semiProductList = []
 				}
 
-				if (this.clientEnvironmentId == 3) {
+				if (this.clientEnvironmentId == 3 && this.taskType == 1) {
 					if (this.objData && this.objData.executorTime && this.objData.executorTime != undefined) {
-						this.objData.workReportInfo['executorTime'] = this.objData.executorTime
-						delete this.objData.executorTime
+						  // 正则表达式1:匹配 yyyy-MM-dd 格式
+						    const dateRegex = /^\d{4}-\d{2}-\d{2}$/;
+							if(dateRegex.test(this.objData.executorTime.trimRight())) {
+								this.objData.workReportInfo['executorTime'] = this.objData.executorTime+' 00:00:00'
+							} else {
+								this.objData.workReportInfo['executorTime'] = this.objData.executorTime
+							}
+					
+						
+					
 					} else {
 						uni.showToast({
 							title: `请先选择实际报工时间`,