ysy пре 1 година
родитељ
комит
70339e4264

+ 1 - 1
api/pda/workOrder.js

@@ -203,7 +203,7 @@ export async function listInProduct(params) {
 
 // 根据工单查委外入库信息
 export async function listOutsourceInWarehouse(params) {
-	const data = await get(
+	const data = await postJ(
 		Vue.prototype.apiUrl + `/mes/applyoutsource/listOutsourceInWarehouse`, params, true,
 	);
 	if (data.code == 0) {

+ 7 - 0
pages.json

@@ -2052,6 +2052,13 @@
 				"navigationStyle": "custom",
 				"navigationBarTextStyle": "white"
 			}
+		},
+		{
+			"path" : "pages/pda/picking/components/outsourceOrder",
+			"style" : 
+			{
+				"navigationBarTitleText" : ""
+			}
 		}
 		
 	],

+ 7 - 24
pages/pda/components/bottomOperate.vue

@@ -24,7 +24,7 @@
 
 			<view class="list rx-bc" v-if="btnState == 1">
 				<view class="list_item_btn" @click="operate('jobBooking', {})">报工</view>
-				<view class="list_item_btn" @click="operate('',item)">批量报工</view>
+				<view class="list_item_btn" @click="operate('',item)">多工单报工</view>
 			</view>
 
 
@@ -66,7 +66,8 @@
 
 
 						<u-form-item label="委外数量:" borderBottom prop="num">
-							<input class="uni-input content_num" :disabled="outsourceForm.type == 2 ? false : true"
+							<!-- :disabled="outsourceForm.type == 2 ? false : true" -->
+							<input class="uni-input content_num" 
 								v-model="outsourceForm.formedNumLast" type='number'></input>
 						</u-form-item>
 
@@ -90,7 +91,7 @@
 						</u-form-item>
 
 						<u-form-item label="委外到:" borderBottom prop="">
-							<zxz-uni-data-select :localdata="newStepsList" v-model="endTaskId" @change="changeOut"
+							<zxz-uni-data-select :localdata="newStepsList" v-model="outsourceForm.taskIds" 
 								dataValue='taskId' format='{taskTypeName}' dataKey="taskId" filterable
 								:clear='true'></zxz-uni-data-select>
 						</u-form-item>
@@ -359,7 +360,7 @@
 				],
 
 				newStepsList: [],
-				endTaskId: null,
+	
 
 				clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
 					.clientEnvironmentId, // *1 主环境-601环境   2 soll-索尔环境    3 tg-碳谷环境
@@ -493,24 +494,6 @@
 				return -1; // 未找到目标值时返回-1
 			},
 
-			changeOut() {
-				if (this.endTaskId) {
-					const index = this.newStepsList.findIndex(item => item.taskId === this.endTaskId) + 1;
-					if (index !== -1) {
-						// 使用slice截取目标元素之前的部分,并通过map提取id
-						const previousIds = this.newStepsList.slice(0, index).map(item => item.taskId);
-						this.outsourceForm.taskIds = previousIds.join(',')
-
-
-					} else {
-						this.outsourceForm.taskIds = ''
-					}
-
-				} else {
-					this.outsourceForm.taskIds = ''
-				}
-				console.log(this.endTaskId)
-			},
 
 
 
@@ -569,14 +552,14 @@
 
 
 
-				if (this.clientEnvironmentId != 2 && !this.outsourceForm.produceRoutingId) {
+				if ( this.outsourceForm.type != 2 && !this.outsourceForm.produceRoutingId) {
 					uni.showToast({
 						title: '请选择工艺路线',
 						icon: 'none'
 					})
 					return false
 				}
-				// this.outsourceForm.requireDeliveryTime = '2025-03-18'
+				this.outsourceForm.requireDeliveryTime = '2025-03-18'
 				if (!this.outsourceForm.requireDeliveryTime) {
 					uni.showToast({
 						title: '请选择委外完成时间',

+ 241 - 0
pages/pda/picking/components/outsourceOrder.vue

@@ -0,0 +1,241 @@
+<template>
+	<view>
+		<u-popup :show="show" :mode='mode' :closeOnClickOverlay='false'>
+
+			<view :style="{paddingTop: mode == 'top' ?  topHight + 'px' : ''}">
+
+				<view class="box_list">
+
+					<u-list @scrolltolower="scrolltolower" class="z_list">
+						<checkbox-group v-for="(item, index) in list" :key="index"
+							@change="e => selectVal(e, item, index)">
+							<label class="listBox rx-bs">
+
+								<view class="listBox-sel">
+									<checkbox :value="item.code" color="#fff" :checked="item.checked" />
+								</view>
+
+								<view class="listBox-con">
+									<view class="listBox-top rx-bc">
+										<view> {{ item.name }} {{item.checked}} </view>
+										<view class="code">
+											{{ item.rootCategoryLevelId == 4 ?  item.codeNumber :  item.code}}
+										</view>
+									</view>
+
+									<view class="listBox-bottom rx">
+
+										<view class="items">
+											<text>委外类型</text> {{ item.deliveryMethod == 2 ? '分批到货' : '一次到货'}}
+										</view>
+
+										<view class="items">
+											<text>委外数量</text>
+											{{item.deliveryMethod == 2 ? item.purchaseQuantity :  item.totalCount}}
+										</view>
+										
+										<view class="items" style="width: calc(100% - 2px);" v-if="item.deliveryMethod == 2">
+											<text>批次号</text>
+											{{ item.batchNo  }}
+										</view>
+										
+
+										<view class="items" style="width: calc(100% - 2px);">
+											<text>委外到货时间</text>
+											{{ item.deliveryMethod == 2 ? timeTure(item.requireDeliveryTime)  : item.requireDeliveryTime }}
+										</view>
+										
+									
+
+
+									</view>
+
+
+
+								</view>
+
+
+
+
+							</label>
+						</checkbox-group>
+
+					</u-list>
+				</view>
+
+				<view class="operate_box  rx-bc">
+
+					<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>
+
+				</view>
+
+
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				mode: 'center',
+				show: false,
+				topHight: 20 || 20,
+
+				list: []
+			}
+		},
+		methods: {
+			close() {
+				this.show = false
+			},
+			open(list) {
+				this.list = []
+				list.forEach(f => {
+					if (f.timeList.length > 0) {
+						f.timeList.forEach(o => {
+							this.list.push({
+								...f,
+								...o
+							})
+
+						})
+					} else {
+						this.list.push(f)
+					}
+				})
+
+				console.log(this.list)
+				this.show = true
+			},
+
+			scrolltolower() {},
+
+			handOK() {
+     
+			
+			let _arr = []
+			this.list.forEach(f => {
+				if(Object.prototype.hasOwnProperty.call(f, 'checked') && f.checked == true) {
+					_arr.push({
+						id: f.id,
+						code: f.code,
+						batchNo: f.batchNo
+					})
+				}
+			})
+			
+			this.$emit('outsourceEmit' ,_arr)
+			this.show = false
+			},
+
+			selectVal(e, val, index) {
+				this.list[index].checked = !this.list[index].checked
+			},
+
+			timeTure(timestamp) {
+				const date = new Date(Number(timestamp)); // 创建 Date 对象
+				const year = date.getFullYear();
+				const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1并补零
+				const day = String(date.getDate()).padStart(2, '0'); // 补零
+				const hours = String(date.getHours()).padStart(2, '0'); // 补零
+				const minutes = String(date.getMinutes()).padStart(2, '0'); // 补零
+				const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零
+
+				// 格式化输出
+				const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+				return formattedDate
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.z_list {
+		max-height: 860rpx;
+	}
+
+	.box_list {
+		min-height: 100rpx;
+		width: 90vw;
+
+		/deep/ .baseForm {
+			padding: 0 20rpx;
+		}
+	}
+
+	.operate_box {
+		padding: 10rpx 32rpx;
+
+		/deep/ .u-button {
+			width: 40%;
+		}
+	}
+
+
+	.listBox {
+		margin-top: 8rpx;
+		padding: 8rpx 24rpx;
+		background: #f5f5f5;
+
+
+		/deep/ .uni-checkbox-input-checked {
+			background-color: $theme-color !important;
+			border-color: $theme-color !important;
+		}
+
+		.listBox-con {
+			width: 650rpx;
+			font-weight: 400;
+		}
+
+		.listBox-top {
+			margin-top: 6rpx;
+			color: #090A0A;
+			font-size: 28rpx;
+			font-style: normal;
+			font-weight: 800;
+		}
+
+		.listBox-bottom {
+			color: #090A0A;
+			font-size: 24rpx;
+			font-style: normal;
+			flex-wrap: wrap;
+
+			.items {
+				width: calc(50% - 1px);
+				border-left: 1rpx solid #E3E5E5;
+				border-right: 1rpx solid #E3E5E5;
+				border-bottom: 1rpx solid #E3E5E5;
+				box-sizing: border-box;
+				word-break: break-all;
+
+				text {
+					display: inline-block;
+					background: #F7F9FA;
+					padding: 8rpx 10rpx;
+					color: #157A2C;
+
+				}
+
+				&:nth-child(1),
+				&:nth-child(2) {
+					border-top: 1rpx solid #E3E5E5;
+					margin-top: 8rpx;
+				}
+
+			}
+
+		}
+	}
+</style>

+ 45 - 13
pages/pda/picking/details.vue

@@ -90,7 +90,8 @@
 						<semiProductBom
 							:list="[...item.semiProductList2, ...item.productList2, ...item.junkProductList2]">
 						</semiProductBom>
-
+						
+					
 
 						<view style="height: 80rpx;"></view>
 
@@ -100,6 +101,13 @@
 					</view>
 
 				</view>
+			
+			
+		<view class="out_box" v-if="isOutsource == 1">
+			<view class="out_text" @click="getListOutsource()">重新获取委外领料单</view>
+		</view>
+			
+			
 			</u-list>
 
 		</view>
@@ -108,6 +116,8 @@
 			<view class="btn_box" @click="save">提交</view>
 
 		</view>
+		
+		<outsourceOrder ref="outsourceRef" @outsourceEmit="outsourceFn"></outsourceOrder>
 
 
 
@@ -120,6 +130,7 @@
 	import boatBom from './components/boatBom.vue'
 	import packingBom from './components/packingBom'
 	import semiProductBom from './components/semiProductBom'
+	import outsourceOrder from './components/outsourceOrder'
 	import {
 		workorderList,
 		listOutsourceInWarehouse,
@@ -137,7 +148,8 @@
 			modelBom,
 			boatBom,
 			packingBom,
-			semiProductBom
+			semiProductBom,
+			outsourceOrder
 		},
 		data() {
 			return {
@@ -164,7 +176,7 @@
 
 
 
-			
+			  this.getList()
 
 			if (this.idsList.length == 1) {
 				this.getPick()
@@ -173,9 +185,7 @@
 
           if(this.isOutsource == 1) {
 			  this.getListOutsource()
-		  }  else {
-			  this.getList()
-		  }
+		  } 
 
 
 
@@ -276,6 +286,7 @@
 			getList() {
 
 				workorderList({
+				
 					ids: this.idsList,
 					taskId: this.taskId
 				}).then(res => {
@@ -328,9 +339,7 @@
 					})
 
 
-					if (this.isOutsource == 1) {
-						this.outsourceInWarehouseFn()
-					}
+				
 
 				})
 			},
@@ -372,16 +381,30 @@
 
 			},
 			
-			getListOutsource() {
+			getListOutsource(list) {
 				let param = {
 					workOrderId: this.idsList,
 					taskId: this.taskId
 				}
 				
 				listOutsource(param).then(res => {
-					console.log(res)
+			
+					if(res) {
+						this.$refs.outsourceRef.open(res)
+					} else {
+					uni.showToast({
+						title: '暂无委外申请单',
+						icon: 'none'
+					})
+					}
 				})
 			},
+			
+			outsourceFn(list) {
+				this.outsourceInWarehouseFn(list)
+				
+		
+			},
 
 
 
@@ -407,9 +430,10 @@
 				})
 			},
 
-			outsourceInWarehouseFn() {
+			outsourceInWarehouseFn(list) {
 				let param = {
-					workOrderId: this.idsList,
+					outsourceOrder: list ||  [],
+					workOrderId: this.idsList[0],
 					taskId: this.taskId
 				}
 
@@ -627,4 +651,12 @@
 		font-weight: 400;
 		color: #fff;
 	}
+	
+	.out_box{
+		margin: 20rpx ;
+		display: flex;
+		justify-content: center;
+		color:  $theme-color;
+		font-size: 28rpx;
+	}
 </style>