From 3196e2328e90063f33093c561d1a75eacb3ef802 Mon Sep 17 00:00:00 2001
From: chenhaozhe <gaozhechen26@gmail.com>
Date: 星期四, 25 九月 2025 20:19:42 +0800
Subject: [PATCH] 解决 其他出库单 多次扫描物料码时 第二次保存失败的问题 原因: 第一次扫描物料条码后,没有将单据设置为有源单模式

---
 pages/qitachuku_v2/form.vue      |   13 +++++++++----
 pages/shengchanlingliao/form.vue |   12 ++++++------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/pages/qitachuku_v2/form.vue b/pages/qitachuku_v2/form.vue
index e96fff4..0213578 100644
--- a/pages/qitachuku_v2/form.vue
+++ b/pages/qitachuku_v2/form.vue
@@ -320,6 +320,8 @@
                 OperationType: 1,
                 HInterID_Temp: '',
 
+                HSourceFlag: false,
+
                 showHStockPlaceName: false,
                 showHMainSourceBillType: true,
                 showHSourceBillNo: true,
@@ -991,6 +993,7 @@
                     success: (res) => {
                         if (res.data.count == 1) {
                             var data = res.data.data
+                            this.HSourceFlag = true
                             console.log(2, data);
                             this.hform.HSupName = data.hSupNameField
                             this.hform.HSupID = data.hSupIDField
@@ -1046,8 +1049,6 @@
                 var sHQty = this.hform.HQty
                 var sSourceBillNo = this.hform.HSourceBillNo
                 var sSourceBillType = this.hform.HMainSourceBillType
-                var HSourceFlag = this.hform.HSourceBillNo == '' ? false : true
-                console.log(this.hform.HSourceBillNo, HSourceFlag)
                 if (HDeleteFlag == "*") {
                     if (sBarCode == "") {
                         this.playSound(0)
@@ -1108,7 +1109,7 @@
                             HSPID: sHSPID,
                             HQty: sHQty,
                             HRedBlueFlag: this.hform.HRedBlueFlag,
-                            SourceFlag: HSourceFlag,
+                            SourceFlag: this.HSourceFlag,
                             HSourceBillNo: sSourceBillNo,
                             HSourceBillType: sSourceBillType,
                             HStockOrgID: this.hform.HStockOrgID,
@@ -1142,6 +1143,7 @@
                                     this.hform.HDeptID = data.hDeptIDField
                                     this.tabs = 1
                                 } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+                                    this.HSourceFlag = true
                                     this.hform.HSupName = data.hSupNameField
                                     this.hform.HSupID = data.hSupIDField
                                     if (data.hDeptIDField != 0) {
@@ -1176,6 +1178,7 @@
                                     this.tabs = 2
                                 } else { //鐗╂枡鏉$爜
                                     this.tabs = 2
+                                    this.HSourceFlag = true
                                     if (!this.hform.HSourceBillNo) {
                                         this.HMainSourceBillType = '鎵嬪伐褰曞叆'
                                         this.hform.HMainSourceBillType = -1
@@ -1187,7 +1190,7 @@
                                 this.DisBillEntryList()
                                 //娓呯┖鏁伴噺
                                 this.hform.HQty = ''
-								this.refreshBarCodeState()
+                                this.refreshBarCodeState()
                             } else {
                                 this.playSound(0)
                                 this.refreshBarCodeState()
@@ -1308,6 +1311,7 @@
             },
             //鏂板
             getNewData() {
+                this.HSourceFlag = false
                 uni.request({
                     url: this.serverUrl + '/WEBSController/GetMaxBillNoAndID_Json',
                     data: {
@@ -1336,6 +1340,7 @@
             },
             //淇敼鍥炲~鏁版嵁
             RoadBillMain(HInterID) {
+                this.HSourceFlag = true
                 uni.request({
                     url: this.serverUrl + '/WEBSController/GetSourceBill_Temp_Json',
                     data: {
diff --git a/pages/shengchanlingliao/form.vue b/pages/shengchanlingliao/form.vue
index f7100b5..9efb389 100644
--- a/pages/shengchanlingliao/form.vue
+++ b/pages/shengchanlingliao/form.vue
@@ -394,9 +394,9 @@
             },
             //鎵弿鍗曟嵁鍙锋潯鐮�
             GetMeesageByBillNo(e) {
-				if(this.hform.HBillNo==""||this.hform.HBillNo==undefined){
-					return
-				}
+                if (this.hform.HBillNo == "" || this.hform.HBillNo == undefined) {
+                    return
+                }
                 uni.request({
                     url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
                     data: {
@@ -529,9 +529,9 @@
             },
             //鎵潯鐮佸鐞�
             getCode(HBarCode) {
-				if(HBarCode==undefined||HBarCode==""){
-					return
-				}
+                if (HBarCode == undefined || HBarCode == "") {
+                    return
+                }
                 //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
                 if (!this.hform.HWHName) {
                     this.hform.HWHID = 0

--
Gitblit v1.9.1