ysy il y a 1 an
Parent
commit
36891d5bdd

+ 12 - 0
api/pda/jobBooking.js

@@ -37,3 +37,15 @@ export async function jobSave(params) {
 }
 
 
+
+
+// 委外报工  工单信息
+export async function outSourceGetByIdReport(id, taskId) {
+  const data = await get(
+   Vue.prototype.apiUrl  + `/pda/mes/workorder/outSourceGetByIdReport/${id}/${taskId}`,
+  );
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}

+ 10 - 9
pages/pda/components/bottomOperate.vue

@@ -24,15 +24,15 @@
 
 		
 		
-		<view  v-if="newTaskObj.existOutsource == 1" class="list rx-bc">
+		<view  v-if="newTaskObj.existOutsource == 1" class="list rx-bc"  @click="operate('outPicking', {})">
 			<view class="round">{{btnList[btnState].length + 1}}</view>
-			<view class="name" @click="operate('outPicking', {})" >委外领料</view>
+			<view class="name" >委外领料</view>
 			<image class="arrow_right" src="~@/static/pda/arrow_right.svg"></image>
 		</view>
 		
-		<view  v-if="newTaskObj.existOutsource == 1" class="list rx-bc">
+		<view  v-if="newTaskObj.existOutsource == 1" class="list rx-bc"  @click="operate('jobBooking', { isOutsource: 1})">
 			<view class="round">{{btnList[btnState].length + 2}}</view>
-			<view class="name" @click="operate('jobBooking', {})" >委外报工</view>
+			<view class="name" >委外报工</view>
 			<image class="arrow_right" src="~@/static/pda/arrow_right.svg"></image>
 		</view>
 		
@@ -70,7 +70,7 @@
 								dataKey="name" filterable format='{name}'></zxz-uni-data-select>
 						</u-form-item>
 
-						<u-form-item label="委外数量:" borderBottom prop="formedNumLast" v-if="clientEnvironmentId == 2">
+						<u-form-item label="委外数量:" borderBottom prop="formedNumLast" >
 							<input class="uni-input content_num" 
 								v-model="outsourceForm.formedNumLast" type='number'></input>
 						</u-form-item>
@@ -129,7 +129,7 @@
 					</u-button>
 
 
-					<u-button type="success" size="small" class="u-reset-button" @click="outsourceOk(0)">
+					<u-button type="success" size="small" class="u-reset-button" @click="outsourceOk()">
                        确定
 					</u-button>
 
@@ -276,7 +276,8 @@
 						},
 						{
 							name: '报工',
-							type: 'jobBooking'
+							type: 'jobBooking',
+							isOutsource: 0
 						},
 						// {
 						// 	name: '多工单报工',
@@ -543,7 +544,7 @@
 			},
 
 
-			outsourceOk(isRelease) {
+			outsourceOk() {
 				if (!this.outsourceForm.name) {
 					uni.showToast({
 						title: '请输入委外名称',
@@ -582,7 +583,7 @@
 					...this.outsourceForm,
 					taskId: this.newTaskObj.currentTaskId,
 					workOrderId: this.newTaskObj.workOrderId,
-					isRelease: isRelease
+					
 				}
 				
 				console.log(param)

+ 18 - 5
pages/pda/components/outsourceList.vue

@@ -256,9 +256,13 @@
 					<u-button size="small" class="u-reset-button" @click="close">
 						取消
 					</u-button>
-					<u-button type="success" size="small" class="u-reset-button" @click="handOK">
+					<u-button type="success" size="small" class="u-reset-button" @click="handOK(0)">
 						提交
 					</u-button>
+					
+					<u-button type="success" size="small" class="u-reset-button" @click="handOK(1)">
+						提交并发布
+					</u-button>
 
 				</view>
 
@@ -351,7 +355,16 @@
 					if (this.clientEnvironmentId == 3 && res.isFirstTask == 1) {
 						this.pickOutInList = [...res.pickOutInList, ...res.materialList]
 					} else {
-						this.pickOutInList = res.pickOutInList
+						this.pickOutInList =  [...res.pickOutInList, ...res.materialList]
+						
+						
+						this.pickOutInList = this.pickOutInList.reduce((acc, item) => {
+						    const existingItem = acc.find(existing => existing.id === item.id);
+						    if (!existingItem) {
+						        acc.push(item);
+						    }
+						    return acc;
+						}, []);
 					}
 
 
@@ -445,10 +458,10 @@
 				})
 			},
 
-			handOK() {
+			handOK(isRelease) {
 				let param = {
 					...this.outObj,
-					isRelease: 0,
+					isRelease: isRelease,
 					bomMaterialList: this.bomMaterialList,
 					pickOutInList: this.pickOutInList.filter(f => f.checked == true),
 					materialList: this.materialList,
@@ -490,7 +503,7 @@
 		padding: 10rpx 32rpx;
 
 		/deep/ .u-button {
-			width: 40%;
+			width: 28%;
 		}
 	}
 

+ 31 - 3
pages/pda/feeding/components/workOrderBom.vue

@@ -29,12 +29,12 @@
 					<view class="lable rx-cc">产品名称</view>
 					<view class="content">{{ item.productName }}</view>
 				</view>
-				
+
 				<view class="item">
 					<view class="lable rx-cc">批次号</view>
 					<view class="content">{{ item.batchNo }}</view>
 				</view>
-				
+
 
 				<view class="item rx-sc">
 					<view class="rx ww55 ">
@@ -63,6 +63,25 @@
 		</view>
 
 
+
+		<view class="title_box mt20 rx-bc" v-if="clientEnvironmentId == 3 && (pType == 'feed' || pType == 'job')">
+			<view class="name">{{ pType == 'feed' ? '实际投料时间' : '实际报工时间'}} </view>
+		</view>
+
+		<view class="material " v-if="clientEnvironmentId == 3 && (pType == 'feed' || pType == 'job')">
+
+			<view class="content_table">
+				<view class="item">
+
+					<view class="content ">
+						<uni-datetime-picker type="datetime" v-model="item.executorTime" />
+					</view>
+				</view>
+
+			</view>
+
+		</view>
+
 	</view>
 </template>
 
@@ -76,12 +95,17 @@
 			isDetails: {
 				type: Boolean,
 				default: false
+			},
+
+			pType: {
+				type: '',
+				default: ''
 			}
 
 		},
 		data() {
 			return {
-
+				clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").clientEnvironmentId
 			}
 		},
 		methods: {
@@ -228,4 +252,8 @@
 			}
 		}
 	}
+
+	.mt20 {
+		margin-top: 20rpx;
+	}
 </style>

+ 14 - 2
pages/pda/feeding/details.vue

@@ -6,7 +6,7 @@
 		<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>
+					<workOrderBom :item='item' pType="feed" @handleScan='handleScan'></workOrderBom>
 
 
 					<paramBom v-if='item.paramDetailList.length != 0' :list='item.paramDetailList'></paramBom>
@@ -257,7 +257,19 @@
 					return false
 				}
 
-
+               if(this.clientEnvironmentId == 3) {
+				   if(this.List[0] && this.List[0].executorTime && this.List[0].executorTime != undefined ) {
+				   } else {
+					   uni.showToast({
+					   	title: `请先选择时间投料时间`,
+					   	icon: 'none'
+					   })
+					   
+					    return false
+				   }
+			   }
+               
+			 
 				batchSave(this.List).then(res => {
 
 					uni.redirectTo({

+ 1 - 1
pages/pda/jobBooking/components/semiProductJobBom.vue

@@ -163,7 +163,7 @@
 			</view>
 
 
-
+             
 			<view class="content_table2" v-if="![1,2,3,4].includes(Number(it.extInfo.notType))">
 				<view class="head row rx-sc">
 					<view class="item ww25" style="font-size: 20rpx;">{{it.extInfo.newWeight ? '上道工序重量' : '物料重量'  }}

+ 43 - 17
pages/pda/jobBooking/index/index.vue

@@ -9,11 +9,12 @@
 
 				<view class="card_box">
 
-					<workOrderBom :item='objData' v-if='objData' @handleScan='handleScan'></workOrderBom>
+					<workOrderBom :item='objData' pType="job" v-if='objData' @handleScan='handleScan'></workOrderBom>
 
 					<paramBom v-if='paramDetailList.length != 0' :list='paramDetailList'></paramBom>
 
-					<deviceBom v-if='objData.equipmentList.length != 0' :list='objData.equipmentList' :ishuoWei="false"></deviceBom>
+					<deviceBom v-if='objData.equipmentList.length != 0' :list='objData.equipmentList' :ishuoWei="false">
+					</deviceBom>
 
 					<modelBom v-if='objData.modelList.length != 0' :list='objData.modelList' pattern='job'
 						ref='modelRef'>
@@ -182,6 +183,7 @@
 <script>
 	import {
 		getByIdReport,
+		outSourceGetByIdReport,
 		getByCodeReport,
 		jobSave
 	} from '@/api/pda/jobBooking.js'
@@ -284,7 +286,8 @@
 					.clientEnvironmentId, // *1 主环境-601环境   2 soll-索尔环境    3 tg-碳谷环境
 
 
-				operateBtn: true
+				operateBtn: true,
+				isOutsource: 0, 
 			}
 		},
 		onLoad(options) {
@@ -292,6 +295,7 @@
 			this.taskType = options.taskType
 			this.id = options.id
 			this.taskId = options.taskId
+			this.isOutsource = options.isOutsource
 			this.getList()
 		},
 
@@ -450,7 +454,7 @@
 
 
 			formedNumFn(num) {
-				console.log(999,num)
+				console.log(999, num)
 				this.$refs.jobRef.setFormedNum(num)
 
 			},
@@ -458,7 +462,9 @@
 
 			getList() {
 				this.isLoad = false
-				getByIdReport(this.id, this.taskId).then(res => {
+				
+				let URL = this.isOutsource == 0  ? getByIdReport :  outSourceGetByIdReport
+				URL(this.id, this.taskId).then(res => {
 
 					this.objData = res
 					console.log(22, res)
@@ -516,7 +522,7 @@
 					}
 
 
-					if (this.taskType == 6 && this.clientEnvironmentId == 3) {
+					if ((this.taskType == 6 || this.isOutsource == 1 ) && this.clientEnvironmentId == 3) {
 						this.objData.semiProductList = this.objData.pickOutInList
 					}
 
@@ -529,7 +535,7 @@
 								taskId: '',
 								taskName: ''
 							}]
-							
+
 							a.extInfo.notBatchReportInfo = [{
 								allFeedQuantity: '',
 								allReportWeight: '',
@@ -538,11 +544,13 @@
 								taskName: '',
 								notReason: ''
 							}]
-							
+
 							return {
 								a
 							}
 						})
+						
+						
 						this.objData.semiProductList = this.objData.semiProductList
 					}
 
@@ -553,7 +561,8 @@
 						formingWeight: null,
 						formedNum: null,
 						formedWeight: null,
-						taskId: this.taskId
+						taskId: this.taskId,
+						executorTime: ''
 
 					}
 
@@ -665,7 +674,7 @@
 					title: '加载中'
 				});
 
-				console.log(this.objData)
+
 
 				if (!this.objData.workReportInfo['formedNum'] && this.objData.workReportInfo['formedNum'] != 0) {
 					uni.showToast({
@@ -692,12 +701,12 @@
 						if (this.taskType == 6) {
 							return e.extInfo.hasOwnProperty('taskId') && e.extInfo.taskId
 						} else {
-						 if(e.extInfo.isQualified == 1 || e.extInfo.notType == 5) {
-							 return e.extInfo.hasOwnProperty('taskId') && e.extInfo.taskId && e.extInfo
-							 	.reportWeight
-						 } else {
-							 return e.extInfo.hasOwnProperty('notType') && e.extInfo.notType 
-						 }
+							if (e.extInfo.isQualified == 1 || e.extInfo.notType == 5) {
+								return e.extInfo.hasOwnProperty('taskId') && e.extInfo.taskId && e.extInfo
+									.reportWeight
+							} else {
+								return e.extInfo.hasOwnProperty('notType') && e.extInfo.notType
+							}
 
 						}
 
@@ -761,10 +770,27 @@
 				}
 
 
-				if (this.clientEnvironmentId == 3 && type == 2 && this.taskType == 6 && this.objData.singleReport ==0) {
+				if (this.clientEnvironmentId == 3 && type == 2 && this.taskType == 6 && this.objData.singleReport ==
+					0) {
 					this.objData.semiProductList = []
 				}
 
+				if (this.clientEnvironmentId == 3) {
+					if (this.objData && this.objData.executorTime && this.objData.executorTime != undefined) {
+						this.objData.workReportInfo['executorTime'] = this.objData.executorTime
+						delete this.objData.executorTime
+					} else {
+						uni.showToast({
+							title: `请先选择实际报工时间`,
+							icon: 'none'
+						})
+
+						return false
+					}
+				}
+
+				console.log('报工', this.objData)
+
 
 				jobSave(this.objData).then(res => {
 

+ 2 - 1
pages/pda/workOrder/extrusionMolding/index.vue

@@ -391,9 +391,10 @@
 					// 		icon: "none",
 					// 	})
 					// }
+				
 					
 					url = '/pages/pda/jobBooking/index/index'
-					url += `?id=${this.info.id}&taskId=${taskId }&taskName=${taskName}&taskType=${this.currentType}`
+					url += `?id=${this.info.id}&taskId=${taskId }&taskName=${taskName}&taskType=${this.currentType}&isOutsource=${item.isOutsource}`
 					uni.navigateTo({
 						url
 					})