From db3cb0b57fdec1a8ba13ed811e12b25dad0cddb2 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期六, 11 十月 2025 15:45:23 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 pages/caigourukujiaoyan/form.vue |  981 ++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 650 insertions(+), 331 deletions(-)

diff --git a/pages/caigourukujiaoyan/form.vue b/pages/caigourukujiaoyan/form.vue
index b98cfcb..dfe29ec 100644
--- a/pages/caigourukujiaoyan/form.vue
+++ b/pages/caigourukujiaoyan/form.vue
@@ -312,57 +312,113 @@
 				})
 			},
 			//鎵弿鍗曟嵁鍙锋潯鐮�
-			GetMeesageByBillNo(e) {
-				if(this.hform.HBillNo==""||this.hform.HBillNo==undefined){
-					return
-				}
-				uni.request({
-					url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
-					data: {
-						HBillNo: this.hform.HBillNo,
-						HBillType: this.hform.HBillType,
-						HMaker: this.hform.HMaker,
-						HStockOrgID: this.hform.HStockOrgID
-					},
-					success: (res) => {
-						if (res.data.count == 1) {
-							CommonUtils.playSound(1);
-							var data = res.data.data
-							console.log('鍗曟嵁淇℃伅: ', data)
-							this.hform.HInterID = data.hInterIDField
-							this.hform.HBillNo = data.hBillNoField
-							this.showHBillNo = false
-							//鏉$爜鏍稿鏍囪
-							if (data.hSourceBarCodeFlagField) {
-								this.hform.HSourceBarCodeCtl = "Y"
-								this.hform.chkHBarflag = true
-								this.hform.HBarflag = data
-							}
-							this.tabs = 2
-							this.DisBillEntryList();
-                            this.refreshHBarCodeFocus()
-						} else {
-							CommonUtils.playSound(0);
-                            this.refreshHBillNoFocus()
-							uni.showToast({
-								title: res.data.Message,
-								icon: 'none'
-							})
-                            
-							// this.hform.HBillNo = ''
-						}
-					},
-					fail: (res) => {
-						CommonUtils.playSound(0);
+            async GetMeesageByBillNo(e) {
+                if (this.hform.HBillNo == "" || this.hform.HBillNo == undefined) {
+                    return
+                }
+            
+                try {
+                    let res = await CommonUtils.doRequest2Sync({
+                        url: '/WEBSController/get_BillBarCode_BillCheck_Json',
+                        data: {
+                            HBillNo: this.hform.HBillNo,
+                            HBillType: this.hform.HBillType,
+                            HMaker: this.hform.HMaker,
+                            HStockOrgID: this.hform.HStockOrgID
+                        },
+                    })
+            
+                    if (!res) {
+                        // 瑙﹀彂璇锋眰閿侊紝涓嶈繑鍥炰换浣曞��
+                        return
+                    }
+            
+                    let {
+                        data,
+                        Message,
+                        count
+                    } = res.data
+                    if (count == 1) {
+                        CommonUtils.playSound(1)
+                        console.log(data)
+                        this.hform.HInterID = data.hInterIDField
+                        this.hform.HBillNo = data.hBillNoField
+                        this.showHBillNo = false
+                        //鏉$爜鏍稿鏍囪
+                        if (data.hSourceBarCodeFlagField) {
+                            this.hform.HSourceBarCodeCtl = "Y"
+                            this.hform.chkHBarflag = true
+                            this.hform.HBarflag = data
+                        }
+                        this.tabs = 2
+                        this.DisBillEntryList();
+                        this.refreshHBarCodeFocus()
+                    } else {
+                        CommonUtils.playSound(0)
                         this.refreshHBillNoFocus()
-						console.log(res);
-						uni.showToast({
-							title: '鎺ュ彛璇锋眰澶辫触',
-							icon: 'none'
-						})
-					},
-				});
-			},
+                        uni.showToast({
+                            title: Message,
+                            icon: 'none'
+                        })
+                        this.hform.HBillNo = ''
+                    }
+            
+                } catch (e) {
+                    CommonUtils.playSound(0)
+                    this.refreshHBillNoFocus()
+                    uni.showToast({
+                        title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+                        icon: 'none'
+                    })
+                }
+                
+                // uni.request({
+                // 	url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
+                // 	data: {
+                // 		HBillNo: this.hform.HBillNo,
+                // 		HBillType: this.hform.HBillType,
+                // 		HMaker: this.hform.HMaker,
+                // 		HStockOrgID: this.hform.HStockOrgID
+                // 	},
+                // 	success: (res) => {
+                // 		if (res.data.count == 1) {
+                // 			CommonUtils.playSound(1);
+                // 			var data = res.data.data
+                // 			console.log('鍗曟嵁淇℃伅: ', data)
+                // 			this.hform.HInterID = data.hInterIDField
+                // 			this.hform.HBillNo = data.hBillNoField
+                // 			this.showHBillNo = false
+                // 			//鏉$爜鏍稿鏍囪
+                // 			if (data.hSourceBarCodeFlagField) {
+                // 				this.hform.HSourceBarCodeCtl = "Y"
+                // 				this.hform.chkHBarflag = true
+                // 				this.hform.HBarflag = data
+                // 			}
+                // 			this.tabs = 2
+                // 			this.DisBillEntryList();
+                //             this.refreshHBarCodeFocus()
+                // 		} else {
+                // 			CommonUtils.playSound(0);
+                //             this.refreshHBillNoFocus()
+                // 			uni.showToast({
+                // 				title: res.data.Message,
+                // 				icon: 'none'
+                // 			})
+                //             
+                // 			// this.hform.HBillNo = ''
+                // 		}
+                // 	},
+                // 	fail: (res) => {
+                // 		CommonUtils.playSound(0);
+                //         this.refreshHBillNoFocus()
+                // 		console.log(res);
+                // 		uni.showToast({
+                // 			title: '鎺ュ彛璇锋眰澶辫触',
+                // 			icon: 'none'
+                // 		})
+                // 	},
+                // });
+            },
 			//鍩虹浠撳簱璧勬枡
 			getHBaseList() {
 				uni.request({
@@ -449,202 +505,377 @@
 					}
 				}
 			},
-			getCode(HBarCode) {
-				console.log(HBarCode);
-				if(HBarCode==undefined||HBarCode==""){
-					return
-				}
-				//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
-				if (!this.hform.HWHName) {
-					this.hform.HWHID = 0
-				}
-				if (!this.hform.HStockPlaceName) {
-					this.hform.HStockPlaceID = 0
-				}
-				var sOldBarCode = HBarCode
-				var HDeleteFlag = sOldBarCode.substring(0, 1);
-				var sBarCode = sOldBarCode.slice(1);
-
-				var sHWHID = this.hform.HWHID
-				var sHSPID = this.hform.HStockPlaceID
-				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 == "") {
-						uni.showToast({
-							title: '璇疯緭鍏ヨ鍒犻櫎鐨勬潯鐮�',
-							icon: 'none'
-						})
-					} else {
-						uni.request({
-							url: this.serverUrl + '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
-							data: {
-								HInterID: this.hform.HInterID,
-								HBillType: this.hform.HBillType,
-								HBarCode: sBarCode
-							},
-							success: (res) => {
-								console.log('鍒犻櫎鏉$爜', res.data);
-								this.hform.HBarCode = ''
-								if (res.data.count == 1) {
-									this.hform.HQty = ''
-									this.DisBillEntryList()
-								} else {
-									uni.showToast({
-										title: res.data.Message,
-										icon: 'none'
-									})
-								}
-							},
-							fail: (res) => {
-								console.log(res);
-								uni.showToast({
-									title: '鎺ュ彛璇锋眰澶辫触',
-									icon: 'none'
-								})
-							},
-						});
-					}
-				} else {
-					var sBarCode = this.hform.HBarCode
-					if (sHQty == "") {
-						sHQty = 0;
-					}
-					console.log("鍗曟嵁淇℃伅: ", this.hform)
-					uni.request({
-						url: this.serverUrl + '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
-						data: {
-							sBarCode: sBarCode,
-							HBillID: this.hform.HInterID || 0,
-							HBillType: this.hform.HBillType,
-							HBillNo: this.hform.HBillNo,
-							HMaker: this.hform.HMaker,
-							HWhID: sHWHID,
-							HSPID: sHSPID,
-							HQty: sHQty,
-							// HRedBlueFlag: this.hform.HRedBlueFlag,
-							// SourceFlag: HSourceFlag,
-							// HSourceBillNo: sSourceBillNo,
-							// HSourceBillType: sSourceBillType,
-							HStockOrgID: this.hform.HStockOrgID,
-							// HScanStyle: "",
-							// HCustom1: "",
-							// HCustom2: ""
-						},
-						success: (res) => {
-							console.log('鎵爜杩斿洖', res.data);
-							// this.hform.HBarCode = ''
-							if (res.data.count == 1) {
-								CommonUtils.playSound(1);
-								var data = res.data.data
-								if (data.hBarTypeField == '浠撳簱鏉$爜') {
-									this.hform.HWHName = data.hWhNameField
-									this.hform.HWHID = data.hWhIDField
-									this.hform.HStockPlaceName = ''
-									this.hform.HStockPlaceID = 0
-									// if (data.hSPFlagField == 0) {
-									// 	this.showHStockPlaceName = false
-									// } else {
-									// 	this.showHStockPlaceName = true
-									// }
-								} else if (data.hBarTypeField == '浠撲綅鏉$爜') {
-									this.hform.HWHName = data.hWhNameField
-									this.hform.HWHID = data.hWhIDField
-									this.hform.HStockPlaceName = data.hSPNameField
-									this.hform.HStockPlaceID = data.hSPIDField
-								} else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
-									this.hform.HDeptName = data.hDeptNameField
-									this.hform.HDeptID = data.hDeptIDField
-									this.tabs = 1
-								} else if (data.hBarTypeField == '婧愬崟鏉$爜') {
-									this.hform.HSupName = data.hSupNameField
-									this.hform.HSupID = data.hSupIDField
-									if (data.hDeptIDField != 0) {
-										this.hform.HDeptID = data.hDeptIDField
-										this.hform.HDeptName = data.hDeptNameField
-									}
-									this.hform.HSourceBillNo = data.hSourceBillNoField
-									//鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-									if (data.hSourceBillTypeField == "1103") {
-										this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
-										this.hform.HMainSourceBillType = 1103
-										this.showHMainSourceBillType = false
-									} else if (data.hSourceBillTypeField == "1102") {
-										this.HMainSourceBillType = '閲囪喘璁㈠崟'
-										this.hform.HMainSourceBillType = 1102
-										this.showHMainSourceBillType = false
-									} else {
-										this.HMainSourceBillType = '鎵嬪伐褰曞叆'
-										this.hform.HMainSourceBillType = -1
-										this.showHMainSourceBillType = false
-									}
-									if (data.hMulSourceFlagField == 0) {
-										this.showHSourceBillNo = false
-									}
-									//渚涘簲鍟嗕笉鍙紪杈�
-									this.showHSupName = false
-									this.tabs = 2
-								} else { //鐗╂枡鏉$爜
-									this.tabs = 2
-									if (!this.hform.HSourceBillNo) {
-										this.hform.HSupName = data.hSupNameField
-										this.hform.HSupID = data.hSupIDField
-										this.hform.HSourceBillNo = data.hSourceBillNoField
-										if (data.hDeptIDField != 0) {
-											this.hform.HDeptID = data.hDeptIDField
-											this.hform.HDeptName = data.hDeptNameField
-										}
-										console.log(data)
-										//鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-										this.hform.HMainSourceBillType = data.hSourceBillTypeField
-										if (data.hSourceBillTypeField == "1103") {
-											this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
-											this.hform.HMainSourceBillType = 1103
-											this.showHMainSourceBillType = false
-										} else if (data.hSourceBillTypeField == "1102") {
-											this.HMainSourceBillType = '閲囪喘璁㈠崟'
-											this.hform.HMainSourceBillType = 1102
-											this.showHMainSourceBillType = false
-										} else {
-											this.HMainSourceBillType = '鎵嬪伐褰曞叆'
-											this.hform.HMainSourceBillType = -1
-											this.showHMainSourceBillType = false
-										}
-										if (data.hMulSourceFlagField == 0) {
-											this.showHSourceBillNo = false
-										}
-										//渚涘簲鍟嗕笉鍙紪杈�
-										this.showHSupName = false
-									}
-								}
-								//鏄剧ず琛ㄤ綋鏄庣粏
-								this.DisBillEntryList()
-								//娓呯┖鏁伴噺
-								this.hform.HQty = ''
-							} else {
-								CommonUtils.playSound(0);
-								uni.showToast({
-									title: res.data.Message,
-									icon: 'none'
-								})
-							}
-                            
-                            this.refreshHBarCodeFocus()
-						},
-						fail: (res) => {
-							CommonUtils.playSound(0);
-							console.log(res);
-                            this.refreshHBarCodeFocus()
-							uni.showToast({
-								title: '鎺ュ彛璇锋眰澶辫触',
-								icon: 'none'
-							})
-						},
-					});
-				}
+			//鎵潯鐮佸鐞�
+			async getCode(HBarCode) {
+			    if (HBarCode == undefined || HBarCode == "") {
+			        return
+			    }
+			    //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
+			    if (!this.hform.HWHName) {
+			        this.hform.HWHID = 0
+			    }
+			    if (!this.hform.HStockPlaceName) {
+			        this.hform.HStockPlaceID = 0
+			    }
+			    var sOldBarCode = HBarCode
+			    var HDeleteFlag = sOldBarCode.substring(0, 1);
+			    var sBarCode = sOldBarCode.slice(1);
+			
+			    var sHWHID = this.hform.HWHID
+			    var sHSPID = this.hform.HStockPlaceID
+			    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 == "") {
+			            uni.showToast({
+			                title: '璇疯緭鍏ヨ鍒犻櫎鐨勬潯鐮�',
+			                icon: 'none'
+			            })
+			        } else {
+			            try {
+			
+			                let res = await CommonUtils.doRequest2Sync({
+			                    url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+			                    data: {
+			                        HInterID: this.hform.HInterID,
+			                        HBillType: this.hform.HBillType,
+			                        HBarCode: sBarCode
+			                    },
+			                })
+			
+			                if (!res) {
+			                    // 璇锋眰琚攣瀹氾紝閫�鍑哄綋鍓嶈姹�
+			                    return
+			                }
+			
+			                console.log('鍒犻櫎鏉$爜', res.data);
+			                this.hform.HBarCode = ''
+			                if (res.data.count == 1) {
+			                    this.hform.HQty = ''
+			                    this.DisBillEntryList()
+			                } else {
+			                    uni.showToast({
+			                        title: res.data.Message,
+			                        icon: 'none'
+			                    })
+			                }
+			
+			            } catch (e) {
+			                CommonUtils.playSound(0)
+			                this.refreshHBillNoFocus()
+			                uni.showToast({
+			                    title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+			                    icon: 'none'
+			                })
+			            }
+			
+			            // uni.request({
+			            //     url: this.serverUrl +
+			            //         '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+			            //     data: {
+			            //         HInterID: this.hform.HInterID,
+			            //         HBillType: this.hform.HBillType,
+			            //         HBarCode: sBarCode
+			            //     },
+			            //     success: (res) => {
+			            //         console.log('鍒犻櫎鏉$爜', res.data);
+			            //         this.hform.HBarCode = ''
+			            //         if (res.data.count == 1) {
+			            //             this.hform.HQty = ''
+			            //             this.DisBillEntryList()
+			            //         } else {
+			            //             uni.showToast({
+			            //                 title: res.data.Message,
+			            //                 icon: 'none'
+			            //             })
+			            //         }
+			            //     },
+			            //     fail: (res) => {
+			            //         console.log(res);
+			            //         uni.showToast({
+			            //             title: '鎺ュ彛璇锋眰澶辫触',
+			            //             icon: 'none'
+			            //         })
+			            //     },
+			            // });
+			        }
+			    } else {
+			        var sBarCode = this.hform.HBarCode
+			        if (sHQty == "") {
+			            sHQty = 0;
+			        }
+			
+			        try {
+			
+			            let res = await CommonUtils.doRequest2Sync({
+			                url: '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
+			                data: {
+			                    sBarCode: sBarCode,
+			                    HBillID: this.hform.HInterID || 0,
+			                    HBillType: this.hform.HBillType,
+			                    HBillNo: this.hform.HBillNo,
+			                    HMaker: this.hform.HMaker,
+			                    HWhID: sHWHID,
+			                    HSPID: sHSPID,
+			                    HQty: sHQty,
+			                    // HRedBlueFlag: this.hform.HRedBlueFlag,
+			                    // SourceFlag: HSourceFlag,
+			                    // HSourceBillNo: sSourceBillNo,
+			                    // HSourceBillType: sSourceBillType,
+			                    HStockOrgID: this.hform.HStockOrgID,
+			                    // HScanStyle: "",
+			                    // HCustom1: "",
+			                    // HCustom2: ""
+			                },
+			            })
+			
+			            if (!res) {
+			                return
+			            }
+			
+			            console.log('鎵爜杩斿洖', res.data);
+			            this.hform.HBarCode = ''
+			            if (res.data.count == 1) {
+			                CommonUtils.playSound(1);
+			                var data = res.data.data
+			                if (data.hBarTypeField == '浠撳簱鏉$爜') {
+			                    this.hform.HWHName = data.hWhNameField
+			                    this.hform.HWHID = data.hWhIDField
+			                    this.hform.HStockPlaceName = ''
+			                    this.hform.HStockPlaceID = 0
+			                    if (data.hSPFlagField == 0) {
+			                        this.showHStockPlaceName = false
+			                    } else {
+			                        this.showHStockPlaceName = true
+			                    }
+			                } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
+			                    this.hform.HWHName = data.hWhNameField
+			                    this.hform.HWHID = data.hWhIDField
+			                    this.hform.HStockPlaceName = data.hSPNameField
+			                    this.hform.HStockPlaceID = data.hSPIDField
+			                } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+			                    this.hform.HDeptName = data.hDeptNameField
+			                    this.hform.HDeptID = data.hDeptIDField
+			                    this.tabs = 1
+			                } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+			                    this.hform.HSupName = data.hSupNameField
+			                    this.hform.HSupID = data.hSupIDField
+			                    if (data.hDeptIDField != 0) {
+			                        this.hform.HDeptID = data.hDeptIDField
+			                        this.hform.HDeptName = data.hDeptNameField
+			                    }
+			                    this.hform.HSourceBillNo = data.hSourceBillNoField
+			                    //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+			                    if (data.hSourceBillTypeField == "1103") {
+			                        this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+			                        this.hform.HMainSourceBillType = 1103
+			                        this.showHMainSourceBillType = false
+			                    } else if (data.hSourceBillTypeField == "1102") {
+			                        this.HMainSourceBillType = '閲囪喘璁㈠崟'
+			                        this.hform.HMainSourceBillType = 1102
+			                        this.showHMainSourceBillType = false
+			                    } else {
+			                        this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+			                        this.hform.HMainSourceBillType = -1
+			                        this.showHMainSourceBillType = false
+			                    }
+			                    if (data.hMulSourceFlagField == 0) {
+			                        this.showHSourceBillNo = false
+			                    }
+			                    //渚涘簲鍟嗕笉鍙紪杈�
+			                    this.showHSupName = false
+			                    this.tabs = 2
+			                } else { //鐗╂枡鏉$爜
+			                    this.tabs = 2
+			                    console.log('data', data)
+			                    if (!this.hform.HSourceBillNo) {
+			                        this.hform.HSupName = data.hSupNameField
+			                        this.hform.HSupID = data.hSupIDField
+			                        this.hform.HSourceBillNo = data.hSourceBillNoField
+			                        if (data.hDeptIDField != 0) {
+			                            this.hform.HDeptID = data.hDeptIDField
+			                            this.hform.HDeptName = data.hDeptNameField
+			                        }
+			                        //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+			                        this.hform.HMainSourceBillType = data.hSourceBillTypeField
+			                        if (data.hSourceBillTypeField == "1103") {
+			                            this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+			                            this.hform.HMainSourceBillType = 1103
+			                            this.showHMainSourceBillType = false
+			                        } else if (data.hSourceBillTypeField == "1102") {
+			                            this.HMainSourceBillType = '閲囪喘璁㈠崟'
+			                            this.hform.HMainSourceBillType = 1102
+			                            this.showHMainSourceBillType = false
+			                        } else {
+			                            this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+			                            this.hform.HMainSourceBillType = -1
+			                            this.showHMainSourceBillType = false
+			                        }
+			                        if (data.hMulSourceFlagField == 0) {
+			                            this.showHSourceBillNo = false
+			                        }
+			                        //渚涘簲鍟嗕笉鍙紪杈�
+			                        this.showHSupName = false
+			                    }
+			                }
+			                //鏄剧ず琛ㄤ綋鏄庣粏
+			                this.DisBillEntryList()
+			                //娓呯┖鏁伴噺
+			                this.hform.HQty = ''
+			            } else {
+			                CommonUtils.playSound(0);
+			                uni.showToast({
+			                    title: res.data.Message,
+			                    icon: 'none'
+			                })
+			            }
+			
+			            this.refreshHBarCodeFocus()
+			
+			        } catch (e) {
+			            CommonUtils.playSound(0)
+			            this.refreshHBillNoFocus()
+			            uni.showToast({
+			                title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+			                icon: 'none'
+			            })
+			        }
+			
+			        // uni.request({
+			        //     url: this.serverUrl + '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
+			        //     data: {
+			        //         sBarCode: sBarCode,
+			        //         HBillID: this.hform.HInterID || 0,
+			        //         HBillType: this.hform.HBillType,
+			        //         HBillNo: this.hform.HBillNo,
+			        //         HMaker: this.hform.HMaker,
+			        //         HWhID: sHWHID,
+			        //         HSPID: sHSPID,
+			        //         HQty: sHQty,
+			        //         // HRedBlueFlag: this.hform.HRedBlueFlag,
+			        //         // SourceFlag: HSourceFlag,
+			        //         // HSourceBillNo: sSourceBillNo,
+			        //         // HSourceBillType: sSourceBillType,
+			        //         HStockOrgID: this.hform.HStockOrgID,
+			        //         // HScanStyle: "",
+			        //         // HCustom1: "",
+			        //         // HCustom2: ""
+			        //     },
+			        //     success: (res) => {
+			        //         console.log('鎵爜杩斿洖', res.data);
+			        //         this.hform.HBarCode = ''
+			        //         if (res.data.count == 1) {
+			        //             CommonUtils.playSound(1);
+			        //             var data = res.data.data
+			        //             if (data.hBarTypeField == '浠撳簱鏉$爜') {
+			        //                 this.hform.HWHName = data.hWhNameField
+			        //                 this.hform.HWHID = data.hWhIDField
+			        //                 this.hform.HStockPlaceName = ''
+			        //                 this.hform.HStockPlaceID = 0
+			        //                 if (data.hSPFlagField == 0) {
+			        //                     this.showHStockPlaceName = false
+			        //                 } else {
+			        //                     this.showHStockPlaceName = true
+			        //                 }
+			        //             } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
+			        //                 this.hform.HWHName = data.hWhNameField
+			        //                 this.hform.HWHID = data.hWhIDField
+			        //                 this.hform.HStockPlaceName = data.hSPNameField
+			        //                 this.hform.HStockPlaceID = data.hSPIDField
+			        //             } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+			        //                 this.hform.HDeptName = data.hDeptNameField
+			        //                 this.hform.HDeptID = data.hDeptIDField
+			        //                 this.tabs = 1
+			        //             } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+			        //                 this.hform.HSupName = data.hSupNameField
+			        //                 this.hform.HSupID = data.hSupIDField
+			        //                 if (data.hDeptIDField != 0) {
+			        //                     this.hform.HDeptID = data.hDeptIDField
+			        //                     this.hform.HDeptName = data.hDeptNameField
+			        //                 }
+			        //                 this.hform.HSourceBillNo = data.hSourceBillNoField
+			        //                 //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+			        //                 if (data.hSourceBillTypeField == "1103") {
+			        //                     this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+			        //                     this.hform.HMainSourceBillType = 1103
+			        //                     this.showHMainSourceBillType = false
+			        //                 } else if (data.hSourceBillTypeField == "1102") {
+			        //                     this.HMainSourceBillType = '閲囪喘璁㈠崟'
+			        //                     this.hform.HMainSourceBillType = 1102
+			        //                     this.showHMainSourceBillType = false
+			        //                 } else {
+			        //                     this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+			        //                     this.hform.HMainSourceBillType = -1
+			        //                     this.showHMainSourceBillType = false
+			        //                 }
+			        //                 if (data.hMulSourceFlagField == 0) {
+			        //                     this.showHSourceBillNo = false
+			        //                 }
+			        //                 //渚涘簲鍟嗕笉鍙紪杈�
+			        //                 this.showHSupName = false
+			        //                 this.tabs = 2
+			        //             } else { //鐗╂枡鏉$爜
+			        //                 this.tabs = 2
+			        //                 console.log('data', data)
+			        //                 if (!this.hform.HSourceBillNo) {
+			        //                     this.hform.HSupName = data.hSupNameField
+			        //                     this.hform.HSupID = data.hSupIDField
+			        //                     this.hform.HSourceBillNo = data.hSourceBillNoField
+			        //                     if (data.hDeptIDField != 0) {
+			        //                         this.hform.HDeptID = data.hDeptIDField
+			        //                         this.hform.HDeptName = data.hDeptNameField
+			        //                     }
+			        //                     //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+			        //                     this.hform.HMainSourceBillType = data.hSourceBillTypeField
+			        //                     if (data.hSourceBillTypeField == "1103") {
+			        //                         this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+			        //                         this.hform.HMainSourceBillType = 1103
+			        //                         this.showHMainSourceBillType = false
+			        //                     } else if (data.hSourceBillTypeField == "1102") {
+			        //                         this.HMainSourceBillType = '閲囪喘璁㈠崟'
+			        //                         this.hform.HMainSourceBillType = 1102
+			        //                         this.showHMainSourceBillType = false
+			        //                     } else {
+			        //                         this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+			        //                         this.hform.HMainSourceBillType = -1
+			        //                         this.showHMainSourceBillType = false
+			        //                     }
+			        //                     if (data.hMulSourceFlagField == 0) {
+			        //                         this.showHSourceBillNo = false
+			        //                     }
+			        //                     //渚涘簲鍟嗕笉鍙紪杈�
+			        //                     this.showHSupName = false
+			        //                 }
+			        //             }
+			        //             //鏄剧ず琛ㄤ綋鏄庣粏
+			        //             this.DisBillEntryList()
+			        //             //娓呯┖鏁伴噺
+			        //             this.hform.HQty = ''
+			        //         } else {
+			        //             CommonUtils.playSound(0);
+			        //             uni.showToast({
+			        //                 title: res.data.Message,
+			        //                 icon: 'none'
+			        //             })
+			        //         }
+			        // 
+			        //         this.refreshHBarCodeFocus()
+			        //     },
+			        //     fail: (res) => {
+			        //         CommonUtils.playSound(0);
+			        //         console.log(res);
+			        //         uni.showToast({
+			        //             title: '鎺ュ彛璇锋眰澶辫触',
+			        //             icon: 'none'
+			        //         })
+			        // 
+			        //         this.refreshHBarCodeFocus()
+			        //     },
+			        // });
+			    }
 			},
 			//鐗╂枡淇℃伅
 			DisBillEntryList() {
@@ -736,91 +967,179 @@
 					}
 				});
 			},
-			submit() {
-				if (this.hform.HInterID == 0 || !this.hform.HInterID) {
-					uni.showToast({
-						title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
-						icon: 'none'
-					})
-				} else if (!this.hform.HBillNo) {
-					uni.showToast({
-						title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�',
-						icon: 'none'
-					})
-				} else if (!this.Materlist || this.Materlist.length == 0) {
-					uni.showToast({
-						title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
-						icon: 'none'
-					})
-				} else {
-					var s = 0;
-					for (var i = 0; i < this.Materlist.length; i++) {
-						if (this.Materlist[i].鏁伴噺 > 0) {
-							s = 1;
-						}
-					}
-					if (s == 0) {
-						uni.showToast({
-							title: '娌℃湁鎵弿鐗╂枡鏉$爜锛岃鍏堟壂鎻忕墿鏂欐潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
-							icon: 'none'
-						})
-					} else {
-						uni.showLoading({
-							title: '璇风◢鍊�'
-						})
-						var sMainStr = JSON.stringify(this.hform);
-						uni.request({
-							url: this.serverUrl + '/WEBSController/set_SavePOStockInBill_BillCheck_Json',
-							method: 'POST',
-							dataType: "json",
-							data: {
-								oMain: sMainStr
-							},
-							success: (res) => {
-								console.log(1, res);
-								uni.hideLoading()
-								if (res.data.count == 1) {
-									uni.showModal({
-										title: '鎻愮ず',
-										content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
-										success: (res) => {
-											if (res.confirm) {
-												console.log('鐢ㄦ埛鐐瑰嚮纭畾');
-												uni.redirectTo({
-													url: '/pages/caigourukujiaoyan/form?OperationType=1'
-												})
-											} else if (res.cancel) {
-												console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
-												setTimeout(() => {
-													uni.navigateBack();
-												}, 50)
-											}
-										}
-									});
-								} else {
-									// uni.showToast({
-									// 	title: res.data.Message,
-									// 	icon: 'none'
-									// })
-
-									uni.showModal({
-										title: '娓╅Θ鎻愮ず',
-										content: res.data.Message,
-										showCancel: false
-									})
-								}
-							},
-							fail: (res) => {
-								console.log(res);
-								uni.showToast({
-									title: '鎺ュ彛璇锋眰澶辫触',
-									icon: 'none'
-								})
-							},
-						});
-					}
-				}
-			},
+            async submit() {
+                if (this.hform.HInterID == 0 || !this.hform.HInterID) {
+                    uni.showToast({
+                        title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
+                        icon: 'none'
+                    })
+                } else if (!this.hform.HBillNo) {
+                    uni.showToast({
+                        title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�',
+                        icon: 'none'
+                    })
+                } else if (!this.Materlist || this.Materlist.length == 0) {
+                    uni.showToast({
+                        title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+                        icon: 'none'
+                    })
+                } else {
+                    var s = 0;
+                    for (var i = 0; i < this.Materlist.length; i++) {
+                        if (this.Materlist[i].鏁伴噺 > 0) {
+                            s = 1;
+                        }
+                    }
+                    // if (s == 0) {
+                    //     uni.showToast({
+                    //         title: '娌℃湁鎵弿鐗╂枡鏉$爜锛岃鍏堟壂鎻忕墿鏂欐潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+                    //         icon: 'none'
+                    //     })
+                    // } else 
+                    {
+                        uni.showLoading({
+                            title: '璇风◢鍊�'
+                        })
+                        var sMainStr = JSON.stringify(this.hform);
+                        try {
+                            let res = await CommonUtils.doRequest2Sync({
+                                url: '/WEBSController/set_SavePOStockInBill_BillCheck_Json',
+                                method: 'POST',
+                                data: {
+                                    oMain: sMainStr
+                                },
+                            })
+                            
+                            if(!res) {
+                                return
+                            }
+                            
+                            console.log(1, res);
+                            uni.hideLoading()
+                            if (res.data.count == 1) {
+                                uni.showModal({
+                                    title: '鎻愮ず',
+                                    content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+                                    success: (res) => {
+                                        if (res.confirm) {
+                                            console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+                                            uni.redirectTo({
+                                                url: '/pages/caigourukujiaoyan/form?OperationType=1'
+                                            })
+                                        } else if (res.cancel) {
+                                            console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+                                            setTimeout(() => {
+                                                uni.navigateBack();
+                                            }, 50)
+                                        }
+                                    }
+                                });
+                            } else {
+                                uni.showToast({
+                                    title: res.data.Message,
+                                    icon: 'none'
+                                })
+                            }
+                            
+                        } catch (e) {
+                            CommonUtils.playSound(0)
+                            this.refreshHBillNoFocus()
+                            uni.showToast({
+                                title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+                                icon: 'none'
+                            })
+                        }
+            
+            
+                        
+                    }
+                }
+            },
+			// submit() {
+			// 	if (this.hform.HInterID == 0 || !this.hform.HInterID) {
+			// 		uni.showToast({
+			// 			title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
+			// 			icon: 'none'
+			// 		})
+			// 	} else if (!this.hform.HBillNo) {
+			// 		uni.showToast({
+			// 			title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�',
+			// 			icon: 'none'
+			// 		})
+			// 	} else if (!this.Materlist || this.Materlist.length == 0) {
+			// 		uni.showToast({
+			// 			title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+			// 			icon: 'none'
+			// 		})
+			// 	} else {
+			// 		var s = 0;
+			// 		for (var i = 0; i < this.Materlist.length; i++) {
+			// 			if (this.Materlist[i].鏁伴噺 > 0) {
+			// 				s = 1;
+			// 			}
+			// 		}
+			// 		if (s == 0) {
+			// 			uni.showToast({
+			// 				title: '娌℃湁鎵弿鐗╂枡鏉$爜锛岃鍏堟壂鎻忕墿鏂欐潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+			// 				icon: 'none'
+			// 			})
+			// 		} else {
+			// 			uni.showLoading({
+			// 				title: '璇风◢鍊�'
+			// 			})
+			// 			var sMainStr = JSON.stringify(this.hform);
+			// 			uni.request({
+			// 				url: this.serverUrl + '/WEBSController/set_SavePOStockInBill_BillCheck_Json',
+			// 				method: 'POST',
+			// 				dataType: "json",
+			// 				data: {
+			// 					oMain: sMainStr
+			// 				},
+			// 				success: (res) => {
+			// 					console.log(1, res);
+			// 					uni.hideLoading()
+			// 					if (res.data.count == 1) {
+			// 						uni.showModal({
+			// 							title: '鎻愮ず',
+			// 							content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+			// 							success: (res) => {
+			// 								if (res.confirm) {
+			// 									console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+			// 									uni.redirectTo({
+			// 										url: '/pages/caigourukujiaoyan/form?OperationType=1'
+			// 									})
+			// 								} else if (res.cancel) {
+			// 									console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+			// 									setTimeout(() => {
+			// 										uni.navigateBack();
+			// 									}, 50)
+			// 								}
+			// 							}
+			// 						});
+			// 					} else {
+			// 						// uni.showToast({
+			// 						// 	title: res.data.Message,
+			// 						// 	icon: 'none'
+			// 						// })
+            // 
+			// 						uni.showModal({
+			// 							title: '娓╅Θ鎻愮ず',
+			// 							content: res.data.Message,
+			// 							showCancel: false
+			// 						})
+			// 					}
+			// 				},
+			// 				fail: (res) => {
+			// 					console.log(res);
+			// 					uni.showToast({
+			// 						title: '鎺ュ彛璇锋眰澶辫触',
+			// 						icon: 'none'
+			// 					})
+			// 				},
+			// 			});
+			// 		}
+			// 	}
+			// },
 
 			goBack() {
 				uni.showModal({

--
Gitblit v1.9.1