zhongtianhaoyuan 1 ano atrás
pai
commit
14025e5bbd
1 arquivos alterados com 14 adições e 10 exclusões
  1. 14 10
      pages/order/confirmUnloading.vue

+ 14 - 10
pages/order/confirmUnloading.vue

@@ -271,7 +271,7 @@
 				})
 			},
 			stop() { //结束定位
-				var that = this
+				let that = this
 				this.shippingNoteInfos[0].shippingNoteNumber = this.detailData.orderNo //运单号
 				this.shippingNoteInfos[0].serialNumber = "0000" //分单号
 				this.shippingNoteInfos[0].startCountrySubdivisionCode = this.detailData
@@ -617,6 +617,7 @@
 				this.detailData.statusFlag = type
 			},
 			async stopMap() {
+				console.log("sjdaisdjdsi")
 				var that = this
 				this.shippingNoteInfos[0].shippingNoteNumber = this.detailData.orderNo //运单号
 				this.shippingNoteInfos[0].serialNumber = "0000" //分单号
@@ -643,13 +644,15 @@
 				this.shippingNoteInfos[0].interval = "5000" //请求时间间隔,SDK 回调返 回(单位 ms)
 				// var shippingNoteInfos = this.shippingNoteInfos;//运单信息列表
 				console.log("查看结束参数", this.shippingNoteInfos)
-				let remark = ""
-				await this.sdkWxStop()
-				console.log(2)
-
+				await this.sdkWxStop().then((res)=>{
+					console.log(2,res)
+				})
+				
 			},
 			sdkWxStop() {
+				let that  = this 
 				return new Promise((resolve, reject) => {
+					let remark = ""
 					sdkwx.stop(this.detailData.carNumber, this.detailData.driverName, remark, this
 						.shippingNoteInfos,
 						function(
@@ -661,6 +664,7 @@
 								//成功
 							} else if (res.type == "onFailure") {
 								console.log("结束成功!!!", res)
+								reject(res.data.errorCode)
 								//失败
 								var errorCode = res.data.errorCode; //错误码
 								var errorMsg = res.data.errorMsg; //错误描述
@@ -668,12 +672,12 @@
 									type: 'error',
 									message: errorMsg,
 								})
-								return
+								// return
 							}
 						})
 				})
 			},
-			confirmClick() {
+			async confirmClick() {
 				var that = this
 				if (this.detailData.statusFlag == 1) {
 					delete this.detailData.carrierInfo.unloadingAreaLongitude;
@@ -729,11 +733,11 @@
 						" " + h + ":" + f + ":" + m
 				}
 				this.detailData.carrierInfo.carNo = this.detailData.carNumber
-
-				if (this.detailData.statusFlag != 1 && this.detailData.cargoOwnerStatus == "运输中") {
-					this.stopMap()
+				if (this.detailData.statusFlag != 1 && this.detailData.orderStatus == "运输中") {
+				 await this.stopMap()
 					console.log(3)
 				}
+				return
 				this.$request.baseRequest('post', '/carrierInfo/unLoadingAdd', this.detailData.carrierInfo).then(res => {
 						console.log(4)
 						if (res.code == 200) {