achao před 1 rokem
rodič
revize
861ce8cd1e
2 změnil soubory, kde provedl 61 přidání a 48 odebrání
  1. 2 1
      pages/goodSource/index.vue
  2. 59 47
      pages/order/confirmUnloading.vue

+ 2 - 1
pages/goodSource/index.vue

@@ -875,7 +875,8 @@
 						_data.loadingPlace = this.startPlace.selected
 					} else {
 						_data.loadingPlaceCity = this.startPlace.fchoosecity
-						_data.loadingPlace = this.startPlace.fchoosearea
+						// _data.loadingPlace = this.startPlace.fchoosearea
+						_data.loadingPlace = ""
 					}
 
 				} else {

+ 59 - 47
pages/order/confirmUnloading.vue

@@ -618,7 +618,8 @@
 			},
 			async stopMap() {
 				console.log("sjdaisdjdsi")
-				var that = this
+				let that = this
+				let _isSubmit = true
 				this.shippingNoteInfos[0].shippingNoteNumber = this.detailData.orderNo //运单号
 				this.shippingNoteInfos[0].serialNumber = "0000" //分单号
 				this.shippingNoteInfos[0].startCountrySubdivisionCode = this.detailData
@@ -644,34 +645,43 @@
 				this.shippingNoteInfos[0].interval = "5000" //请求时间间隔,SDK 回调返 回(单位 ms)
 				// var shippingNoteInfos = this.shippingNoteInfos;//运单信息列表
 				console.log("查看结束参数", this.shippingNoteInfos)
-				await this.sdkWxStop().then((res)=>{
-					console.log(2,res)
-				})
-				
+				try {
+					await this.sdkWxStop().then((res) => {
+						console.log(2, res)
+					})
+				} catch (e) {
+					uni.hideLoading()
+					console.log(22, e.data.errorMsg)
+					that.$refs.uToast.show({
+						type: 'error',
+						message: e.data.errorMsg,
+					})
+					_isSubmit = false
+				}
+				return _isSubmit
 			},
 			sdkWxStop() {
-				let that  = this 
+				let that = this
 				return new Promise((resolve, reject) => {
 					let remark = ""
 					sdkwx.stop(this.detailData.carNumber, this.detailData.driverName, remark, this
 						.shippingNoteInfos,
-						function(
-							res) {
+						function(res) {
 							console.log(1)
 							if (res.type == "onSuccess") {
 								resolve(res)
 								console.log("结束成功!!!", res)
 								//成功
 							} else if (res.type == "onFailure") {
-								console.log("结束成功!!!", res)
-								reject(res.data.errorCode)
+								console.log("结束成功!!失败!", res)
 								//失败
-								var errorCode = res.data.errorCode; //错误码
-								var errorMsg = res.data.errorMsg; //错误描述
-								that.$refs.uToast.show({
-									type: 'error',
-									message: errorMsg,
-								})
+								reject(res)
+								// var errorCode = res.data.errorCode; //错误码
+								// var errorMsg = res.data.errorMsg; //错误描述
+								// that.$refs.uToast.show({
+								// 	type: 'error',
+								// 	message: errorMsg,
+								// })
 								// return
 							}
 						})
@@ -729,44 +739,46 @@
 					m = "0" + m
 				}
 				if (this.detailData.carrierInfo.unloadingDate) { //卸车时间 去当前时间的时分秒
-					this.detailData.carrierInfo.unloadingDate = this.detailData.carrierInfo.unloadingDate.split(" ")[0] +
+					this.detailData.carrierInfo.unloadingDate = this.detailData.carrierInfo.unloadingDate.split(" ")[
+							0] +
 						" " + h + ":" + f + ":" + m
 				}
 				this.detailData.carrierInfo.carNo = this.detailData.carNumber
 				if (this.detailData.statusFlag != 1 && this.detailData.orderStatus == "运输中") {
-				 await this.stopMap()
+					let _data = await this.stopMap()
 					console.log(3)
+					if (!_data) return
 				}
-				return
-				this.$request.baseRequest('post', '/carrierInfo/unLoadingAdd', this.detailData.carrierInfo).then(res => {
-						console.log(4)
-						if (res.code == 200) {
-							let _title = ''
-							if (this.detailData.statusFlag == 1) {
-								_title = '暂存成功!'
-							} else {
-								// that.stop()
-								_title = '提交成功!'
-							}
-							uni.hideLoading()
-							that.$refs.uToast.show({
-								type: 'success',
-								message: _title,
-								complete() {
-									uni.hideLoading()
-									uni.switchTab({
-										url: '/pages/order/index'
-									})
-									if (that.$helper.fUN_AmapLocation) {
-										that.$helper.fUN_AmapLocation.stop({}, result => {
-											console.log('====fUN_AmapLocation定位stop====', JSON
-												.stringify(result));
-										});
-									}
+				this.$request.baseRequest('post', '/carrierInfo/unLoadingAdd', this.detailData.carrierInfo).then(
+						res => {
+							console.log(4)
+							if (res.code == 200) {
+								let _title = ''
+								if (this.detailData.statusFlag == 1) {
+									_title = '暂存成功!'
+								} else {
+									// that.stop()
+									_title = '提交成功!'
 								}
-							})
-						}
-					})
+								uni.hideLoading()
+								that.$refs.uToast.show({
+									type: 'success',
+									message: _title,
+									complete() {
+										uni.hideLoading()
+										uni.switchTab({
+											url: '/pages/order/index'
+										})
+										if (that.$helper.fUN_AmapLocation) {
+											that.$helper.fUN_AmapLocation.stop({}, result => {
+												console.log('====fUN_AmapLocation定位stop====', JSON
+													.stringify(result));
+											});
+										}
+									}
+								})
+							}
+						})
 					.catch(res => {
 						uni.$u.toast(res.message);
 					});