From cd78554c3da306ed8c866d971bee94457665f80c Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期六, 30 八月 2025 17:35:51 +0800
Subject: [PATCH] ERP一期接口

---
 项目代码/龙利得PDA/pages/stash/boxing.vue |  190 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 154 insertions(+), 36 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\351\276\231\345\210\251\345\276\227PDA/pages/stash/boxing.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\351\276\231\345\210\251\345\276\227PDA/pages/stash/boxing.vue"
index 917db35..2c7b93c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\351\276\231\345\210\251\345\276\227PDA/pages/stash/boxing.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\351\276\231\345\210\251\345\276\227PDA/pages/stash/boxing.vue"
@@ -4,7 +4,7 @@
 		</uni-segmented-control>
 		<view class="content">
 			<view v-if="current === 0" class="headerstyle">
-				<view class="itemstyle">
+				<view class="itemstyle" v-if="warehouseId==1">
 					<uni-forms label-width="180">
 						<uni-forms-item label="鏉$爜:">
 							<uni-easyinput type="text" placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" ref='midInput' :focus="!focus"
@@ -28,20 +28,41 @@
 						</uni-forms-item>
 					</uni-forms>
 				</view>
-			</view>
-			<view v-if="current === 1" class="headerstyle" >
-				<view class="itemstyle">
+				<view class="itemstyle" v-else>
 					<uni-forms label-width="120">
 						<uni-forms-item label="鎵樼洏鏉$爜">
-							<uni-easyinput type="text" :focus="!addressFocus" v-model="inboundBarcode"
-								placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" ref='midInput' @input="inputChangebarcode" />
+							<uni-easyinput type="text" :focus="!addressEmptyFocus" v-model="inboundCode"
+								placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" ref='midInput' @confirm="inputChangeemptyCode" />
 						</uni-forms-item>
 						<uni-forms-item label="鍦板潃鏉$爜">
-							<uni-easyinput type="text" v-model="address" :disabled="addressdisabled"
-								placeholder="璇锋壂鎻忓湴鍧�鏉$爜" ref='midInput' :focus="addressFocus" />
+							<uni-easyinput type="text" v-model="address" placeholder="璇锋壂鎻忓湴鍧�鏉$爜" ref='midInput'
+								:focus="addressEmptyFocus" />
+						</uni-forms-item>
+						<uni-forms-item label="鐗╂枡缂栫爜">
+							<uni-easyinput type="text" v-model="matCode" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�" ref='midInput' />
+						</uni-forms-item>
+						<uni-forms-item label="鐗╂枡鏁伴噺">
+							<uni-easyinput type="number" v-model="matCount" placeholder="璇疯緭鍏ョ墿鏂欐暟閲�" ref='midInput' />
 						</uni-forms-item>
 						<uni-forms-item>
 							<button @click="inbound" type="primary" size="default" style="margin-top: 2%;">鍏ュ簱纭</button>
+						</uni-forms-item>
+					</uni-forms>
+				</view>
+			</view>
+			<view v-if="current === 1" class="headerstyle">
+				<view class="itemstyle">
+					<uni-forms label-width="120">
+						<uni-forms-item label="鎵樼洏鏉$爜">
+							<uni-easyinput type="text" :focus="!addressEmptyFocus" v-model="emptyCode"
+								placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" ref='midInput' @confirm="inputChangeemptyCode" />
+						</uni-forms-item>
+						<uni-forms-item label="鍦板潃鏉$爜">
+							<uni-easyinput type="text" v-model="addressEmpty" placeholder="璇锋壂鎻忓湴鍧�鏉$爜" ref='midInput'
+								:focus="addressEmptyFocus" />
+						</uni-forms-item>
+						<uni-forms-item>
+							<button @click="inEmpty" type="primary" size="default" style="margin-top: 2%;">鍏ュ簱纭</button>
 						</uni-forms-item>
 					</uni-forms>
 				</view>
@@ -56,33 +77,55 @@
 	export default {
 		data() {
 			return {
-				items: ['缁勭洏', '鍏ュ簱'], //, '鍗曟嵁淇℃伅', '瑙g洏'
-				materSn:"",
-				wide:"",
-				weight:"",
-				thickness:"",
+				items: ['缁勭洏'], //, '鍗曟嵁淇℃伅', '瑙g洏'
+				materSn: "",
+				wide: "",
+				weight: "",
+				thickness: "",
 				barcode: "",
-				focus:false,
+				focus: false,
 				inboundBarcode: "",
 				address: "",
 				addressdisabled: true,
 				addressFocus: false,
 				current: 0,
+				inboundCode: "",
 				orderNo: "",
 				warehouseId: "",
 				Test: false,
+				emptyCode: "",
+				matCount: 0,
+				matCode: "", //鐗╂枡缂栫爜
+				addressEmpty: "",
+				addressEmptyFocus: false,
 			}
 		},
 		onShow() {},
 		onLoad(res) {
 			this.focus = false;
 			this.addressFocus = false;
+			this.Test=false;
 			this.warehouseId = res.warehouseId;
-			if (this.warehouseId == 1) { 
-				this.items=['缁勭洏'];
+			if (this.warehouseId == 1) {
+				this.items = ['缁勭洏'];
+			}
+			if (this.warehouseId == 2) {
+				//浠呮樉绀簎ni-segmented-control涓�1鍜�2鐨勫��
+				this.items.push('杈呮枡鍏ュ簱');
+				this.items.push('绌烘墭鍏ュ簱');
+				//this.items绉婚櫎缁勭洏
+				this.items.splice(0,1);
 			}
 		},
 		methods: {
+			onClickItem(e) {
+				this.barcodeFo = true;
+				this.focus = false;
+				this.addressFocus = false;
+				if (this.current !== e.currentIndex) {
+					this.current = e.currentIndex;
+				}
+			},
 			barcodeInput() {
 				this.$nextTick(function(x) {
 					if (this.barcode.length > 0) {
@@ -90,37 +133,42 @@
 					}
 				})
 			},
-			inbound() {
-				if (this.inboundBarcode == "") {
+			inputChangeemptyCode() {
+				if (this.emptyCode.length > 0) {
+					this.addressEmptyFocus = true;
+				} else {
+					this.addressEmptyFocus = false;
+				}
+				
+				if(this.inboundCode){
+					this.addressEmptyFocus = true;
+				}else {
+					this.addressEmptyFocus = false;
+				}
+			},
+			inEmpty() {
+				if (this.emptyCode == "") {
 					this.$refs.uToast.show({
 						title: "璇锋壂鎻忔墭鐩樻潯鐮�",
 						type: "error"
 					})
 					return;
 				}
-				if (this.address == "") {
+				if (this.addressEmpty == "") {
 					this.$refs.uToast.show({
 						title: "璇锋壂鎻忓湴鍧�鏉$爜",
 						type: "error"
 					})
 					return;
 				}
-				var postData = {
-					MainData: {
-						"barcode": this.inboundBarcode,
-						"startPoint": this.address,
-						"warehouseId": this.warehouseId
-					}
-				}
-				this.$u.post('/api/Task/RequestInboundTask', postData).then(res => {
+				var url = "?barCode=" + this.emptyCode + "&startPoint=" + this.addressEmpty;
+				this.$u.post('/api/Task/EmptyBackTask' + url, {}).then(res => {
 					if (res.status) {
-						this.inboundBarcode = "";
-						if (this.warehouseId != 5 && this.warehouseId != 3) this.address = "";
-						this.stockInfoDetail = [];
+						this.emptyCode = "";
+						this.addressEmpty = "";
 						//鑾峰彇鎬绘暟閲�
-						this.Summmary = 0;
 						setTimeout(() => {
-							this.addressFocus = false;
+							this.addressEmptyFocus = false;
 							this.$refs.uToast.show({
 								title: "鎴愬姛",
 								type: "success"
@@ -139,6 +187,75 @@
 					})
 				})
 			},
+			inbound() {
+				if (this.matCount <= 0) {
+					this.$refs.uToast.show({
+						title: "璇疯緭鍏ョ墿鏂欐暟閲�",
+						type: "error"
+					})
+					return;
+				}
+				if(!this.Test){
+					this.$refs.uToast.show({
+						title: "璇风‘璁ょ墿鏂欐暟閲�"+this.matCount,
+						type: "info"
+					})
+					this.Test=true;
+					return;
+				}
+				if (this.inboundCode == "") {
+					this.$refs.uToast.show({
+						title: "璇锋壂鎻忔墭鐩樻潯鐮�",
+						type: "error"
+					})
+					return;
+				}
+				if (this.address== "") {
+					this.$refs.uToast.show({
+						title: "璇锋壂鎻忓湴鍧�鏉$爜",
+						type: "error"
+					})
+					return;
+				}
+				if (this.matCode == "") {
+					this.$refs.uToast.show({
+						title: "璇疯緭鍏ョ墿鏂欑紪鐮�",
+						type: "error"
+					})
+					return;
+				}
+				
+				var url = "?barCode=" + this.inboundCode + "&startPoint=" + this.address + "&matCode=" + this
+					.matCode + "&matCount=" + this.matCount;
+				this.$u.post('/api/Task/InboundFLTask' + url, {}).then(res => {
+					if (res.status) {
+						this.inboundCode = "";
+						this.address = "";
+						this.matCode = "";
+						this.matCount = 0;
+						this.Test=false;
+						//鑾峰彇鎬绘暟閲�
+						setTimeout(() => {
+							this.addressEmptyFocus = false;
+							this.$refs.uToast.show({
+								title: "鎴愬姛",
+								type: "success"
+							})
+						}, 200);
+					} else {
+						this.$refs.uToast.show({
+							title: res.message,
+							type: "error"
+						})
+						this.Test=false;
+					}
+				}).catch(err => {
+					this.$refs.uToast.show({
+						title: err.message,
+						type: "error"
+					})
+				})
+			},
 			submit() {
 				if (this.barcode == "") {
 					this.$refs.uToast.show({
@@ -147,7 +264,7 @@
 					})
 					return;
 				}
-				this.$u.post('/api/StockInfo/ManualMaterielGroup' ,{
+				this.$u.post('/api/StockInfo/ManualMaterielGroup', {
 					MainData: {
 						"palletCode": this.barcode,
 						"thickness": this.thickness,
@@ -166,9 +283,10 @@
 						})
 						this.focus = false;
 						this.barcode = "";
-						this.matInfos = [];
-						this.sns = [];
-						this.matTotal = [];
+						this.materSn = "";
+						this.wide = "";
+						this.weight = "";
+						this.thickness = "";
 					} else {
 						this.$refs.uToast.show({
 							title: res.message,

--
Gitblit v1.9.3