From 687cf225be540a32222f5761a105b05eab1c13c4 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 26 三月 2026 16:23:20 +0800
Subject: [PATCH] #成品直送

---
 pages/outbound/productDirectDelivery.vue |  651 +++++++++++++++++++++++++++++++++++++---------------------
 pages/outbound/matDirectDelivery.vue     |    1 
 2 files changed, 415 insertions(+), 237 deletions(-)

diff --git a/pages/outbound/matDirectDelivery.vue b/pages/outbound/matDirectDelivery.vue
index e99e59b..511bc55 100644
--- a/pages/outbound/matDirectDelivery.vue
+++ b/pages/outbound/matDirectDelivery.vue
@@ -39,7 +39,6 @@
 						v-model="whAreaId"
 						:localdata="range"
 						placement="bottom"
-						@change="selChange"
 					></uni-data-select>
 				</view>
 			</view>
diff --git a/pages/outbound/productDirectDelivery.vue b/pages/outbound/productDirectDelivery.vue
index 30000b4..511bc55 100644
--- a/pages/outbound/productDirectDelivery.vue
+++ b/pages/outbound/productDirectDelivery.vue
@@ -2,282 +2,461 @@
 	<view class="has-foot">
 		<form>
 			<view class="cu-form-group margin-top">
+				<view class="title">璁㈠崟鍙�</view>
+				<input
+					placeholder="璇烽�夋嫨璁㈠崟缂栫爜"
+					v-model="orderNo"
+					@input="getOrderItemList"
+				/>
+			</view>
+			<view class="cu-form-group">
 				<view class="title">鎺ラ┏绔欑偣</view>
-				<input placeholder="璇锋壂鎻忔帴椹崇珯鐐规潯鐮�" v-model="barcode" ></input>
-				<!-- <text class='cuIcon-search text-blue' @click="search"></text> -->
-			</view>	
+				<input
+					placeholder="璇锋壂鎻忔帴椹崇珯鐐规潯鐮�"
+					v-model="barcode"
+					@input="checkAgvStation"
+				/>
+			</view>
+			<view
+				class="cu-form-group"
+				v-if="agvStationName"
+			>
+				<view class="title">绔欑偣缂栫爜</view>
+				<text>{{ agvStationName }}</text>
+			</view>
 			<view class="cu-form-group">
 				<view class="title">瀹瑰櫒鍙�</view>
-				<input placeholder="璇锋壂鎻忓鍣ㄧ紪鐮�" v-model="barcode" ></input>
-				<text class='cuIcon-search text-blue' @click="search"></text>
-			</view>	
-<!-- 			<view class="flex solid-bottom padding-sm justify-between">
-				<view class="text-blue margin-left">瀹瑰櫒鐮�:{{container}}</view>				
-			</view> -->
+				<input
+					placeholder="璇锋壂鎻忓鍣ㄧ紪鐮�"
+					v-model="container"
+				/>
+			</view>
 			<view class="cu-form-group">
-				<view class="title">璁㈠崟鍙�</view>
-				<input placeholder="璇烽�夋嫨璁㈠崟缂栫爜" v-model="barcode" ></input>
-				<text class='cuIcon-search text-blue' @click="search"></text>
-			</view>	
-			<view class="cu-form-group">
-				<view class="title">鐩爣绔欑偣</view>
-				<view style="width: 75%;">
-					<uni-data-select style="min-width: 50%; max-width: 100%;" v-model="whAreaId" :localdata="range"
-						placement="bottom" @change="selChange"></uni-data-select>
+				<view class="title">鐩爣绔欏尯</view>
+				<view style="width: 75%">
+					<uni-data-select
+						style="min-width: 50%; max-width: 100%"
+						v-model="whAreaId"
+						:localdata="range"
+						placement="bottom"
+					></uni-data-select>
 				</view>
+			</view>
+			<view class="flex solid-bottom padding-sm justify-between">
+				<view class="text-blue">鐗╂枡绉嶇被:{{ list.length }}</view>
 			</view>
 		</form>
 
-
-		<view class="cu-list det menu sm-border  padding">
-			<block v-for="(item, index) in list" :key="index">
-				<view class="cu-bar bg-white solid-bottom margin-top-sm">
-					<view class="action">
-						<view class="index">
-							{{index+1}}
+		<view
+			class="padding-lr margin-top-sm"
+			style="padding-bottom: 120upx"
+		>
+			<block
+				v-for="(item, index) in list"
+				:key="index"
+			>
+				<view
+					class="cu-list det menu sm-border margin-bottom-sm"
+					:class="[item.trackCode === barcode && 'act']"
+					:ref="item.trackCode + 'ref'"
+				>
+					<view class="cu-bar bg-white solid-bottom">
+						<view class="action">
+							<view class="index">
+								{{ index + 1 }}
+							</view>
+							<view class="text-blue">
+								鐗╂枡缂栫爜:
+								{{ `${item.matnrCode}` }}
+							</view>
 						</view>
-						<view class="text-blue">
-							{{`${item.maktx}`}}
+						<view
+							class="action"
+							v-if="!isconfirm"
+						>
+							<text
+								@click="remove(index)"
+								class="cuIcon-close text-red"
+								style="font-size: 24px"
+							></text>
 						</view>
 					</view>
-					<!-- 	<view class="action" >
-						<text @click="remove(index)" class="cuIcon-close text-red" style="font-size: 24px;"></text>
-					</view> -->
-				</view>
-
-				<view class="cu-item">
-					<view class="content">
-						<text class="text-black">ASN:</text>
+					<view class="cu-item">
+						<view class="content">
+							<text class="text-black">鐗╂枡鍚嶇О:</text>
+							<text class="text-grey">{{ item.maktx }}</text>
+						</view>
 					</view>
-					<view class="action">
-						<text class="text-grey ">{{item.asnCode}}</text>
+					<view class="cu-item">
+						<view class="content">
+							<text class="text-black">鍗曟嵁缂栫爜:</text>
+						</view>
+						<view class="action">
+							<text class="text-grey">{{ item.asnCode }}</text>
+						</view>
+					</view>
+					<view class="cu-item">
+						<view class="content">
+							<text class="text-black">璁″垝璺熻釜鍙�:</text>
+						</view>
+						<view class="action">
+							<text class="text-grey">
+								{{ item.platWorkCode }}
+							</text>
+						</view>
+					</view>
+					<view class="cu-item">
+						<view class="content">
+							<text class="text-black">鎵规:</text>
+						</view>
+						<view class="action">
+							<text class="text-grey">{{ item.splrBatch }}</text>
+						</view>
+					</view>
+					<view class="cu-item">
+						<view class="content">
+							<text class="text-black">
+								鍗曚綅:
+								<text class="text-grey">
+									{{ item.stockUnit }}
+								</text>
+							</text>
+						</view>
+						<view class="content">
+							<text class="text-black">
+								鏀惰揣鏁伴噺:
+								<text class="text-grey">{{ item.anfme }}</text>
+							</text>
+						</view>
+						<!-- <view class="content">
+							<text class="text-black">宸蹭笂鏋舵暟閲�: <text
+									class="text-grey ">{{item.workQty + item.qty}}</text></text>
+						</view> -->
+					</view>
+					<view class="cu-item">
+						<view class="content">
+							<text class="text-black">
+								闇�姹傛暟閲�:
+								<text class="text-grey">
+									{{ item.ableQty }}
+								</text>
+							</text>
+						</view>
+					</view>
+					<view class="cu-item">
+						<view class="content">
+							<view class="cu-form-group padding-lr-0">
+								<view class="title text-blue">
+									<text
+										class="text-red text-xl vertical-middle"
+									>
+										*
+									</text>
+									鏁伴噺:
+								</view>
+								<uni-number-box
+									style="width: 70%"
+									:min="0"
+									:max="item.ableQty"
+									:decimal="2"
+									:step="0.01"
+									v-model="item.demandQty"
+								></uni-number-box>
+							</view>
+						</view>
 					</view>
 				</view>
-				<view class="cu-item">
-					<view class="content">
-						<text class="text-black">鎵规:</text>
-					</view>
-					<view class="action">
-						<text class="text-grey ">{{item.batch}}</text>
-					</view>
-				</view>
-
-
-				<view class="cu-item">
-					<view class="content">
-						<text class="text-black">鏀惰揣鏁伴噺:</text>
-					</view>
-					<view class="action">
-						<text class="text-grey ">{{item.anfme}}</text>
-					</view>
-				</view>
-
 			</block>
 		</view>
 
-
 		<view class="cu-bar btn-group foot">
-			<button class="cu-btn text-blue line-blue shadow" @click="clear">娓呯┖</button>
-			<button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="confirm">杩愰��</button>
+			<button
+				class="cu-btn text-blue line-blue shadow"
+				@click="clear"
+			>
+				娓呯┖
+			</button>
+			<button
+				class="cu-btn bg-blue shadow-blur"
+				:disabled="repeatClick"
+				@click="check"
+			>
+				杩愰��
+			</button>
 		</view>
-
-		
-
 	</view>
 </template>
 
 <script>
-	import {
-		request
-	} from '../../common/request.js'
-	import {
-		mapState,
-		mapMutations,
-		mapActions,
-		mapGetters
-	} from 'vuex';
-	export default {
-		data() {
-			return {
-				barcode: '',
-				areaName: '',
-				locCode: '',
-				container: '',
-				list: [],
-				range: [],
-				curCode: '',
-				whAreaId:'',
-				repeatClick: false,
-				
+import { request } from '../../common/request.js'
+import { mapState, mapMutations, mapActions, mapGetters } from 'vuex'
+export default {
+	data() {
+		return {
+			orderNo: '',
+			barcode: '',
+			areaName: '',
+			locCode: '',
+			container: '',
+			list: [],
+			range: [],
+			curCode: '',
+			whAreaId: '',
+			repeatClick: false,
+			isconfirm: false,
+			agvStationName: ''
+		}
+	},
+	computed: {
+		...mapState('user', ['dynamicFields'])
+	},
+	mounted() {
+		this.getRece()
+		this.whAreaId = uni.getStorageSync('whAreaId')
+	},
+	methods: {
+		async checkAgvStation() {
+			const that = this
+			if (this.barcode === '' || this.barcode === null) {
+				uni.showToast({
+					title: '瀹瑰櫒鐮佷负绌�',
+					icon: 'none',
+					position: 'top'
+				})
+				return
+			}
+			const { code, data, msg } = await request('/check/agvStation', {
+				transferStationNo: this.barcode
+			})
+			if (code === 200) {
+				this.agvStationName = data.stationId
+			} else {
+				uni.showToast({
+					title: msg,
+					icon: 'none',
+					position: 'top'
+				})
+				setTimeout(function () {
+					that.agvStationName = ''
+					that.barcode = ''
+				}, 200)
 			}
 		},
-		computed: {
-			...mapState('user', ['dynamicFields']),
-		},
-		mounted() {
-			this.getRece()
-			this.whAreaId = uni.getStorageSync('whAreaId')
-		},
-		methods: {	
-			selChange(val) {
-				uni.setStorageSync('whAreaId', val)
-			},
-			async search() {
-				let that = this
-				const {
-					code,
-					data,
-					msg
-				} = await request('/staBind/list', {
-					sta: this.barcode
+		async getOrderItemList() {
+			const that = this
+			if (this.orderNo === '' || this.orderNo === null) {
+				uni.showToast({
+					title: '璁㈠崟鍙蜂负绌�',
+					icon: 'none',
+					position: 'top'
 				})
-				if (code === 200) {	
-					if(data.list.length >0){
-						that.container = data.barcode						
-						that.list = data.list
-					}
-					that.range = data.warehouseAreasList.map(item => ({
-						value: item.id,
-						text: item.name
-					}));
-					that.whAreaId = data.area
+				return
+			}
+			const { code, data, msg } = await request(
+				'/orderOut/getOrderItem',
+				{
+					orderNo: this.orderNo
+				}
+			)
+			if (code === 200) {
+				if (data.length > 0) {
+					this.list = data
 				} else {
 					uni.showToast({
-						title: msg,
-						icon: "none",
+						title: '璇ヨ鍗曞彲鎵ц琛屾暟涓虹┖',
+						icon: 'none',
+						position: 'top'
 					})
 				}
-			},
-
-			remove(index) {
-				this.list.splice(index, 1);
-			},
-			clear() {
-				this.list = []
-				
-				this.container = ''
-				this.barcode = ''
-			},
-
-			open() {
-				this.$refs.popup.open()
-			},
-
-			close() {
-				this.$refs.popup.close()
-			},
-
-			popupSubmit() {
-				this.$refs.popup.close()
-			},
-			itemChange(el) {
-				this.curCode = el
-			},
-
-			async confirm() {				
-				if(this.barcode === '' || this.barcode ===null){
-					uni.showToast({
-						title: "鎺ラ┏绔欑偣涓嶈兘涓虹┖",
-						icon: "none",
-					})
-					return ;
+			} else {
+				uni.showToast({
+					title: msg,
+					icon: 'none',
+					position: 'top'
+				})
+				setTimeout(function () {
+					that.orderNo = ''
+				}, 200)
+			}
+		},
+		selChange(val) {
+			uni.setStorageSync('whAreaId', val)
+		},
+		async search() {
+			let that = this
+			const { code, data, msg } = await request('/staBind/list', {
+				sta: this.barcode
+			})
+			if (code === 200) {
+				if (data.list.length > 0) {
+					that.container = data.barcode
+					that.list = data.list
 				}
-				if(this.whAreaId === '' || this.whAreaId ===null){
-					uni.showToast({
-						title: "鐩爣搴撳尯涓嶈兘涓虹┖",
-						icon: "none",
-					})
-					return ;
-				} 
-				this.repeatClick = true
-				const {
-					code,
-					data,
-					msg
-				} = await request('/AGV/task/start',{						
-						sta: this.barcode,
-						area: this.whAreaId
-					}
-				)
-				if (code === 200) {
-					uni.showToast({
-						title: '鍚姩鎴愬姛'
-					})
-					this.clear()
-				} else {
-					uni.showToast({
-						title: msg,
-						icon: "none",
-					})
-				}
-				this.repeatClick = false
-			},
-			
-			async getRece() {				
-				const {
-					code,
-					data,
-					msg
-				} = await request('/areas/receipt', {}, 'get')
-				if (code === 200) {
-					this.range = data.map(item => ({
-						value: item.id,
-						text: item.warehouseId$ + "-- " + item.name
-					}));
-				}
-			},
+				that.range = data.warehouseAreasList.map((item) => ({
+					value: item.id,
+					text: item.name
+				}))
+				that.whAreaId = data.area
+			} else {
+				uni.showToast({
+					title: msg,
+					icon: 'none'
+				})
+			}
+		},
+
+		remove(index) {
+			this.list.splice(index, 1)
+		},
+		clear() {
+			this.list = []
+
+			this.container = ''
+			this.barcode = ''
+		},
+
+		open() {
+			this.$refs.popup.open()
+		},
+
+		close() {
+			this.$refs.popup.close()
+		},
+
+		popupSubmit() {
+			this.$refs.popup.close()
+		},
+		itemChange(el) {
+			this.curCode = el
+		},
+		check() {
+			if (this.barcode === '' || this.barcode === null) {
+				uni.showToast({
+					title: '鎺ラ┏绔欑偣涓嶈兘涓虹┖',
+					icon: 'none'
+				})
+				return
+			}
+			if (this.orderNo === '' || this.orderNo === null) {
+				uni.showToast({
+					title: '璁㈠崟鍙蜂笉鑳戒负绌�',
+					icon: 'none'
+				})
+				return
+			}
+			if (this.container === '' || this.container === null) {
+				uni.showToast({
+					title: '瀹瑰櫒鍙蜂笉鑳戒负绌�',
+					icon: 'none'
+				})
+				return
+			}
+			if (this.whAreaId === '' || this.whAreaId === null) {
+				uni.showToast({
+					title: '鐩爣搴撳尯涓嶈兘涓虹┖',
+					icon: 'none'
+				})
+				return
+			}
+			if (this.list.length === 0) {
+				uni.showToast({
+					title: '鏄庣粏椤逛笉鑳戒负绌�',
+					icon: 'none'
+				})
+				return
+			}
+			this.confirm()
+		},
+		async confirm() {
+			this.repeatClick = true
+			const { code, data, msg } = await request(
+				'/orderOut/productionDirectDelivery',
+				{
+					orderNo: this.orderNo,
+					containerNo: this.container,
+					sta1: this.barcode,
+					stationAreaId: this.whAreaId,
+					wkOrderItems: this.list
+				},
+				'POST'
+			)
+			if (code === 200) {
+				uni.showToast({
+					title: '鍚姩鎴愬姛'
+				})
+				this.clear()
+			} else {
+				uni.showToast({
+					title: msg,
+					icon: 'none'
+				})
+			}
+			this.repeatClick = false
+		},
+
+		async getRece() {
+			const { code, data, msg } = await request(
+				'/orderOut/getStationArea',
+				{}
+			)
+			if (code === 200) {
+				this.range = data.map((item) => ({
+					value: item.id,
+					text: item.stationAreaName
+				}))
+			}
 		}
 	}
+}
 </script>
 
 <style>
-	.index {
-		border: 1px solid #e54d42;
-		color: #e54d42;
-		border-radius: 50%;
-		display: block;
-		width: 50rpx;
-		height: 50rpx;
-		line-height: 48rpx;
-		text-align: center;
-		margin-right: 20rpx;
-		font-size: 30rpx;
-	}
+.index {
+	border: 1px solid #e54d42;
+	color: #e54d42;
+	border-radius: 50%;
+	display: block;
+	width: 50rpx;
+	height: 50rpx;
+	line-height: 48rpx;
+	text-align: center;
+	margin-right: 20rpx;
+	font-size: 30rpx;
+}
 
-	.text-blue {
-		color: #0081ff !important;
+.text-blue {
+	color: #0081ff !important;
+}
 
-	}
+.item {
+	position: relative;
+	display: flex;
+	min-height: 80upx;
+	align-items: center;
+}
 
-	.item {
-		position: relative;
-		display: flex;
-		min-height: 80upx;
-		align-items: center;
-	}
+.uni-file-picker {
+	width: 100%;
+	margin-bottom: 10px;
+}
 
-	.uni-file-picker {
-		width: 100%;
-		margin-bottom: 10px;
-	}
+.uni-select__selector {
+	z-index: 999;
+}
 
-	.uni-select__selector {
-		z-index: 999;
-	}
+.tj {
+	height: auto;
+	padding: 6px 8px;
+	display: inline-block;
+	border-radius: 6px;
+}
 
-	.tj {
-		height: auto;
-		padding: 6px 8px;
-		display: inline-block;
-		border-radius: 6px;
-	}
+.item {
+	display: flex;
+	justify-content: center;
+}
 
-	.item {
-		display: flex;
-		justify-content: center;
-	}
-
-	.item .cu-btn {
-		font-size: 26upx;
-	}
-</style>
\ No newline at end of file
+.item .cu-btn {
+	font-size: 26upx;
+}
+</style>

--
Gitblit v1.9.1