From 5fd3121f9782559ad5cd0596bafa3b239d1dc615 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期二, 23 九月 2025 09:14:56 +0800
Subject: [PATCH] 修改 采购入库模块 新增 输入框自动聚焦 修改 生成领料单校验 模块 物料信息显示 源单数量

---
 pages/caigourukujiaoyan/form.vue                 |   38 ++++++++-
 components/BillListPopup/BillListPopup_Check.vue |    2 
 .hbuilderx/launch.json                           |    2 
 pages/shengchanlingliao/form.vue                 |  169 ++++++++++++++++++++++-------------------
 4 files changed, 125 insertions(+), 86 deletions(-)

diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index 4dd14cd..d7abf73 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -25,7 +25,7 @@
             "localRepoPath" : "D:/WorkBench/ZY_APP_Dev/STUWMS/unpackage/debug",
             "openVueDevtools" : true,
             "packageName" : "com.shebeiguanli.www",
-            "playground" : "standard",
+            "playground" : "custom",
             "type" : "uni-app:app-android"
         }
     ]
diff --git a/components/BillListPopup/BillListPopup_Check.vue b/components/BillListPopup/BillListPopup_Check.vue
index 62c2d72..313a915 100644
--- a/components/BillListPopup/BillListPopup_Check.vue
+++ b/components/BillListPopup/BillListPopup_Check.vue
@@ -76,7 +76,7 @@
                 length: 0,
                 page: 0,
                 HBillNo: '',
-                HMater: this.HMater,
+                // HMater: this.HMater,
                 HCustom: '',
                 HBillList: [],
                 panelHeight: 0,
diff --git a/pages/caigourukujiaoyan/form.vue b/pages/caigourukujiaoyan/form.vue
index 2f961a4..c3cec0a 100644
--- a/pages/caigourukujiaoyan/form.vue
+++ b/pages/caigourukujiaoyan/form.vue
@@ -4,7 +4,7 @@
 			<view class="form-item">
 				<view class="title">鏉$爜:</view>
 				<view class="right">
-					<input v-model="hform.HBarCode" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜" @confirm="getCode(hform.HBarCode)" />
+					<input v-model="hform.HBarCode" :focus="HBarCodeFocus" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜" @confirm="getCode(hform.HBarCode)" />
 				</view>
 				<uni-icons type="scan"
 					style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
@@ -45,7 +45,7 @@
 					<view class="title">鍗曟嵁鍙�:</view>
 					<view class="right" style="width: 380rpx;">
 						<input name="HBillNo" v-model="hform.HBillNo" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
-							@confirm="GetMeesageByBillNo(hform.HBarCode)" />
+							@confirm="GetMeesageByBillNo(hform.HBarCode)" :focus="HBillNoFocus"/>
 					</view>
 					<uni-icons type="scan"
 						style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
@@ -81,8 +81,8 @@
 			</view>
 			<view v-if="tabs == 2">
 				<view class="list" v-for="(item,index) in Materlist" :key="index">
-					<uni-card :title="item.鐗╂枡鍚嶇О" :extra="'鏁伴噺:'+item.鏁伴噺" style="margin: 10px;" @tap="delMater(item)">
-						<view class="card-detail">
+                    <uni-card :title="item.鐗╂枡鍚嶇О" :extra="'鏁伴噺:'+item.鏁伴噺" style="margin: 10px;" @tap="delMater(item)">
+                        <view class="card-detail">
 							<view class="detail">
 								<text>鐗╂枡浠g爜锛�</text>{{item.鐗╂枡浠g爜}}
 							</view>
@@ -188,6 +188,9 @@
 	export default {
 		data() {
 			return {
+                HBarCodeFocus: false,
+                HBillNoFocus: false,
+                
 				userInfo: getUserInfo(),
 				serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
 				HModName: 'Kf_POStockInBill_CheckList_PDA',
@@ -249,8 +252,24 @@
 				// this.getNewData()
 			}
 			this.getHBaseList()
+            
+            this.refreshHBillNoFocus()
 		},
 		methods: {
+            // 鍒锋柊鍗曟嵁鍙疯仛鐒�
+            async refreshHBillNoFocus() {
+                this.HBillNoFocus = false
+                this.hform.HBillNo = '',
+                await this.$nextTick()
+                this.HBillNoFocus = true
+            },
+            // 鍒锋柊鏉$爜鑱氱劍
+            async refreshHBarCodeFocus() {
+                this.HBarCodeFocus = false
+                this.hform.HBarCode = ''
+                await this.$nextTick()
+                this.HBarCodeFocus = true
+            },
 			//鎵爜
 			toScanCode() {
 				var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
@@ -314,17 +333,21 @@
 							}
 							this.tabs = 2
 							this.DisBillEntryList();
+                            this.refreshHBarCodeFocus()
 						} else {
 							CommonUtils.playSound(0);
+                            this.refreshHBillNoFocus()
 							uni.showToast({
 								title: res.data.Message,
 								icon: 'none'
 							})
-							this.hform.HBillNo = ''
+                            
+							// this.hform.HBillNo = ''
 						}
 					},
 					fail: (res) => {
 						CommonUtils.playSound(0);
+                        this.refreshHBillNoFocus()
 						console.log(res);
 						uni.showToast({
 							title: '鎺ュ彛璇锋眰澶辫触',
@@ -502,7 +525,7 @@
 						},
 						success: (res) => {
 							console.log('鎵爜杩斿洖', res.data);
-							this.hform.HBarCode = ''
+							// this.hform.HBarCode = ''
 							if (res.data.count == 1) {
 								CommonUtils.playSound(1);
 								var data = res.data.data
@@ -597,10 +620,13 @@
 									icon: 'none'
 								})
 							}
+                            
+                            this.refreshHBarCodeFocus()
 						},
 						fail: (res) => {
 							CommonUtils.playSound(0);
 							console.log(res);
+                            this.refreshHBarCodeFocus()
 							uni.showToast({
 								title: '鎺ュ彛璇锋眰澶辫触',
 								icon: 'none'
diff --git a/pages/shengchanlingliao/form.vue b/pages/shengchanlingliao/form.vue
index b1d4162..1592728 100644
--- a/pages/shengchanlingliao/form.vue
+++ b/pages/shengchanlingliao/form.vue
@@ -4,7 +4,8 @@
             <view class="form-item">
                 <view class="title">鏉$爜:</view>
                 <view class="right" style="width: 380rpx;">
-                    <input v-model="hform.HBarCode" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜" @confirm="getCode(hform.HBarCode)" />
+                    <input v-model="hform.HBarCode" :focus="HBarCodeFocus" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
+                        @confirm="getCode(hform.HBarCode)" />
                 </view>
                 <uni-icons type="scan"
                     style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
@@ -51,16 +52,16 @@
                         style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
                         size="20" @click="toScanCode"></uni-icons>
                 </view>
-				<view class="form-item" v-show="showHBillNo">
-				    <view class="title">鍗曟嵁鍙�(鐗╂枡):</view>
-				    <view class="right" style="width: 380rpx;">
-				        <input name="HBillNoMater" :focus="HBillNoFocusMater" v-model="HBillNoMater" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
-				            @confirm="showBillList()" />
-				    </view>
-				    <uni-icons type="scan"
-				        style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
-				        size="20" @click="toScanCodeMater"></uni-icons>
-				</view>
+                <view class="form-item" v-show="showHBillNo">
+                    <view class="title">鍗曟嵁鍙�(鐗╂枡):</view>
+                    <view class="right" style="width: 380rpx;">
+                        <input name="HBillNoMater" :focus="HBillNoFocusMater" v-model="HBillNoMater"
+                            placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜" @confirm="showBillList()" />
+                    </view>
+                    <uni-icons type="scan"
+                        style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
+                        size="20" @click="toScanCodeMater"></uni-icons>
+                </view>
                 <view class="form-item" v-show="!showHBillNo">
                     <view class="title">鍗曟嵁鍙�:</view>
                     <view class="righton">
@@ -96,9 +97,7 @@
                             <view class="detail">
                                 <text>鐗╂枡浠g爜锛�</text>{{item.鐗╂枡浠g爜}}
                             </view>
-                            <view class="detail" v-if="item.鎬绘暟閲�">
-                                <text>鎬绘暟閲忥細</text>{{item.鎬绘暟閲弣}
-                            </view>
+
                             <view class="detail" v-if="item.瑙勬牸鍨嬪彿">
                                 <text>瑙勬牸鍨嬪彿锛�</text>{{item.瑙勬牸鍨嬪彿}}
                             </view>
@@ -114,7 +113,9 @@
                             <view class="detail" v-if="item.鐢熶骇璁㈠崟鍙�">
                                 <text>鐢熶骇璁㈠崟鍙凤細</text>{{item.鐢熶骇璁㈠崟鍙穧}
                             </view>
-
+                            <view class="detail" v-if="item.鍗曟嵁鏁伴噺">
+                                <text>婧愬崟鏁伴噺锛�</text>{{item.鍗曟嵁鏁伴噺}}
+                            </view>
                         </view>
                     </uni-card>
                 </view>
@@ -185,13 +186,13 @@
                 <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
             </view>
         </view>
-		<BillListPopupVue ref="billList" :HBillType="hform.HBillType" :HMater='HBillNoMater'
-			:HStockOrgID="hform.HStockOrgID" :MultiSourceBill="false"></BillListPopupVue>
+        <BillListPopupVue ref="billList" :HBillType="hform.HBillType" :HMater='HBillNoMater'
+            :HStockOrgID="hform.HStockOrgID" :MultiSourceBill="false"></BillListPopupVue>
     </view>
 </template>
 <script>
     import getDateTime from '@/utils/getdateTime.js';
-	import BillListPopupVue from '../../components/BillListPopup/BillListPopup_Check.vue';
+    import BillListPopupVue from '../../components/BillListPopup/BillListPopup_Check.vue';
     import {
         getUserInfo
     } from "@/utils/auth.js";
@@ -206,10 +207,11 @@
                 HModName: 'Kf_MateOutBill_Check_PDA',
                 ModRightName: 'CE_MateOutCheck',
                 OperationType: 1,
-				
+
+                HBarCodeFocus: false,
                 HBillNoFocus: false,
-				HBillNoFocusMater:false,
-				HBillNoMater:'',
+                HBillNoFocusMater: false,
+                HBillNoMater: '',
                 showHBillNo: true,
                 tabs: 1,
                 linterid: '',
@@ -257,13 +259,13 @@
                 }
             }
         },
-        components:{
-			BillListPopupVue
-		},
-		onUnload() {
-			uni.$off('BillSelectComplete')
-		},
-		onLoad(e) {
+        components: {
+            BillListPopupVue
+        },
+        onUnload() {
+            uni.$off('BillSelectComplete')
+        },
+        onLoad(e) {
             console.log(e, this.userInfo)
             this.OperationType = e.OperationType
             if (e.HBillNo) {
@@ -274,32 +276,32 @@
                 this.refreshHBillNoFocus()
             }
             this.getHBaseList()
-			uni.$on('BillSelectComplete', async (e) => {
-			    console.log("鎺ユ敹鍒扮殑娑堟伅: ", e)
-			    console.log("鏄惁搴旂敤澶氭簮鍗�: ", e.enableMultiSourceBill)
-			    if(e.enableMultiSourceBill){
-			        for(let item of e.MultiSourceBillList) {
-			            try{
-			                this.hform.HBillNo = e.HBillNo
-							await this.GetMeesageByBillNo()
-			            }catch {
-			                return
-			            }
-			        }
-			        this.$refs.billList.exit()
-			        // if(e.MultiSourceBillList.length != 0){
-			        //      this.showHSourceBillNo = false
-			        // }
-			       
-			    }else {
-			        this.hform.HBillNo = e.HBillNo
-			        this.GetMeesageByBillNo()
-			        this.$refs.billList.exit()
-			    }
-			})
+            uni.$on('BillSelectComplete', async (e) => {
+                console.log("鎺ユ敹鍒扮殑娑堟伅: ", e)
+                console.log("鏄惁搴旂敤澶氭簮鍗�: ", e.enableMultiSourceBill)
+                if (e.enableMultiSourceBill) {
+                    for (let item of e.MultiSourceBillList) {
+                        try {
+                            this.hform.HBillNo = e.HBillNo
+                            await this.GetMeesageByBillNo()
+                        } catch {
+                            return
+                        }
+                    }
+                    this.$refs.billList.exit()
+                    // if(e.MultiSourceBillList.length != 0){
+                    //      this.showHSourceBillNo = false
+                    // }
+
+                } else {
+                    this.hform.HBillNo = e.HBillNo
+                    this.GetMeesageByBillNo()
+                    this.$refs.billList.exit()
+                }
+            })
         },
         onUnload() {
-        	uni.$off('BillSelectComplete')
+            uni.$off('BillSelectComplete')
         },
         methods: {
             toScanCode2() {
@@ -310,10 +312,10 @@
                     'timeoutText': '鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋            
                 }, (ret) => {
                     console.log(ret.resp_result)
-                    if(this.hform.HBarCode == '*'){
-                    	this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
-                    }else{
-                    	this.hform.HBarCode = ret.resp_result
+                    if (this.hform.HBarCode == '*') {
+                        this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
+                    } else {
+                        this.hform.HBarCode = ret.resp_result
                     }
                     // this.hform.HBillNo = ret.resp_result
                     this.getCode(ret.resp_result)
@@ -349,6 +351,12 @@
                     }
                 })
 
+            },
+            async refreshHBarCodeFocus() {
+                this.HBarCodeFocus = false
+                await this.$nextTick()
+                this.hform.HBarCode = ''
+                this.HBarCodeFocus = true
             },
             async refreshHBillNoFocus() {
                 this.HBillNoFocus = false
@@ -410,6 +418,7 @@
                             }
                             this.tabs = 2
                             this.DisBillEntryList();
+                            this.refreshHBarCodeFocus()
                         } else {
                             this.playSound(0)
                             this.refreshHBillNoFocus()
@@ -692,6 +701,8 @@
                                     icon: 'none'
                                 })
                             }
+
+                            this.refreshHBarCodeFocus()
                         },
                         fail: (res) => {
                             console.log(res);
@@ -699,6 +710,8 @@
                                 title: '鎺ュ彛璇锋眰澶辫触',
                                 icon: 'none'
                             })
+
+                            this.refreshHBarCodeFocus()
                         },
                     });
                 }
@@ -896,28 +909,28 @@
                     }
                 });
             },
-			//鍗曟嵁鏌ヨ鍒楄〃鏄剧ず
-			showBillList(){
-				this.$refs.billList.showPopup()
-			},
-			toScanCodeMater() {
-			    var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
-			    mpaasScanModule.mpaasScan({
-			        'hideAlbum': true,
-			        'timeoutInterval': '10', //瓒呮椂鏃堕棿
-			        'timeoutText': '鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋            
-			    }, (ret) => {
-			        console.log(ret.resp_result)
-			        // if(this.hform.HBarCode == '*'){
-			        // 	this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
-			        // }else{
-			        // 	this.hform.HBarCode = ret.resp_result
-			        // }
-			        this.HBillNoMater = ret.resp_result
-			        this.$refs.billList.showPopup()
-			    })
-			},
-		}
+            //鍗曟嵁鏌ヨ鍒楄〃鏄剧ず
+            showBillList() {
+                this.$refs.billList.showPopup()
+            },
+            toScanCodeMater() {
+                var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
+                mpaasScanModule.mpaasScan({
+                    'hideAlbum': true,
+                    'timeoutInterval': '10', //瓒呮椂鏃堕棿
+                    'timeoutText': '鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋            
+                }, (ret) => {
+                    console.log(ret.resp_result)
+                    // if(this.hform.HBarCode == '*'){
+                    // 	this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
+                    // }else{
+                    // 	this.hform.HBarCode = ret.resp_result
+                    // }
+                    this.HBillNoMater = ret.resp_result
+                    this.$refs.billList.showPopup()
+                })
+            },
+        }
     }
 </script>
 

--
Gitblit v1.9.1