gjy преди 2 години
родител
ревизия
fe83d04bfa
променени са 5 файла, в които са добавени 180 реда и са изтрити 96 реда
  1. 3 3
      App.vue
  2. 2 2
      config/index.js
  3. 143 76
      pages/goodSource/selectCity.vue
  4. 26 13
      pages/order/confirmLoading.vue
  5. 6 2
      pages/order/confirmUnloading.vue

+ 3 - 3
App.vue

@@ -93,9 +93,9 @@
 								}
 								this.$helper.gjList.push(_data)
 								uni.setStorageSync('mapGJ', this.$helper.gjList);
-								console.log('this.$helper.gjList')
-								console.log(this.$helper.gjList)
-								console.log("条数", uni.getStorageSync('mapGJ').length)
+								// console.log('this.$helper.gjList')
+								// console.log(this.$helper.gjList)
+								// console.log("条数", uni.getStorageSync('mapGJ').length)
 								if (uni.getStorageSync('mapGJ').length > 100) {
 									console.log(JSON.stringify(uni.getStorageSync('mapGJ')) )
 									this.$request.baseRequest('post', '/hyOrderTravelPath/api/addInfo',  {

+ 2 - 2
config/index.js

@@ -1,6 +1,6 @@
 const dev = {
-	// baseUrlNew: 'https://apitest.eliangeyun.com',
-	baseUrlNew: 'http://192.168.110.9:8099',
+	baseUrlNew: 'https://apitest.eliangeyun.com',
+	// baseUrlNew: 'http://192.168.110.9:8099',
 	// baseUrlNew: 'http://192.168.110.82:8999',
 	// baseUrlNew: 'http://192.168.1.119:8999',
 	h5Appid: 'wxb66b599f7f61b46f',

+ 143 - 76
pages/goodSource/selectCity.vue

@@ -120,6 +120,8 @@
 				type: 0,
 				count: 0,
 				ftitle: '',
+				ftitleList:[],
+				stitleList:[],
 				stitle: '',
 				selectList: [],
 			}
@@ -224,14 +226,16 @@
 				}
 			},
 			confirmBtn() {
+				
 				//设置地区 0发货地 1收货地
-				// if (this.type == 0||this.type == 1) {
+				if (this.type == 0) {
 					if (this.fchooseprovince == '选择' ||(this.fchoosearea == '请选择区'&&this.fchoosecity!='全部')|| (this.fchoosecity == '请选择市' && this.fchooseprovince != '全国')) {
-						this.$refs.uToast.show({
-							type: 'error',
-							message: "请选择区域!",
-						})
-						return
+							this.$refs.uToast.show({
+								type: 'error',
+								message: "请选择区域!",
+							})
+					return
+					}
 					// }
 					console.log("省", this.fchooseprovince)
 					console.log("市", this.fchoosecity)
@@ -272,17 +276,18 @@
 					uni.setStorageSync('fPlaceObj', _obj);
 					//选择区
 					if (this.fchoosearea != '请选择区' && this.fchoosearea != '全部') {
-						let _list = this.fchoosearea.split(',')
-						let _newList
-						//设置历史收发地并去重,区重名判断是否是同一个市在去重
-						for (let i = 0; i < _list.length; i++) {
-							let _deepObj = uni.$u.deepClone(_obj)
-							_deepObj.selected = _list[i]
-							this.historyFcityList.unshift(_deepObj)
-							_newList = this.makeHistoryList(_deepObj)
-
-						}
-						console.log(_newList)
+						console.log(this.fchooseprovince,this.fchoosecity,this.fchoosearea)
+						// let _list = this.fchoosearea.split(',')
+						// let _newList
+						// //设置历史收发地并去重,区重名判断是否是同一个市在去重
+						// for (let i = 0; i < _list.length; i++) {
+						// 	let _deepObj = uni.$u.deepClone(_obj)
+						// 	_deepObj.selected = _list[i]
+						// 	this.historyFcityList.unshift(_deepObj)
+						// 	_newList = this.makeHistoryList(_deepObj)
+
+						// }
+						// console.log(_newList)
 						uni.setStorageSync('fPlaceList', this.historyFcityList);
 						uni.setStorageSync('fPlaceObj', {
 							fchooseprovince: this.fchooseprovince,
@@ -380,11 +385,13 @@
 						this.fchoosearea = ''
 						this.ftitle = ''
 						this.isfcity = null
+						this.ftitleList=[]
 					} else {
 						this.schoosecity = '请选择市'
 						this.schoosearea = ''
 						this.stitle = ''
 						this.isscity = null
+						this.stitleList=[]
 					}
 				} else if ((this.type == 0 ? this.fstatus : this.sstatus) == 0) {
 					if (this.type == 0) {
@@ -420,19 +427,23 @@
 						this.fchooseprovince = '选择'
 						this.fchoosecity = '请选择市'
 						this.fchoosearea = '请选择区'
+						this.ftitleList=[]
 					} else {
 						this.schooseprovince = '选择'
 						this.schoosecity = '请选择市'
 						this.schoosearea = '请选择区'
+						this.stitleList=[]
 					}
 
 				} else if (status == 1) {
 					if (this.type == 0) {
 						this.fchoosecity = '请选择市'
 						this.fchoosearea = '请选择区'
+						this.ftitleList=[]
 					} else {
 						this.schoosecity = '请选择市'
 						this.schoosearea = '请选择区'
+						this.stitleList=[]
 					}
 				}
 			},
@@ -529,6 +540,7 @@
 								this.farealist[i].checked = false
 							}
 						}
+						this.ftitleList=[]
 						this.fchoosearea = '全部'
 						this.$forceUpdate()
 						return
@@ -540,82 +552,137 @@
 								this.sarealist[i].checked = false
 							}
 						}
+						this.stitleList=[]
 						this.schoosearea = '全部'
 						this.$forceUpdate()
 						return
 					}
 				}
-
-				if (this.count < 3) {
-					item.checked = !item.checked
-					if (item.checked && this.count < 3) {
-						this.count++;
-					} else if (!item.checked && this.count < 3) {
-						this.count--;
-					}
-				} else {
-					if (item.checked) {
-						item.checked = !item.checked
-						this.count--;
-					} else {
-						this.$refs.uToast.show({
-							type: 'error',
-							message: "最多选择3个地区",
-						})
-					}
-				}
-				this.$forceUpdate()
-				//设置面包屑 0发货地 1收货地
 				if (this.type == 0) {
-					if (item.checked && !this.fchoosearea.includes(item.label)) {
-						if (this.ftitle) {
-							this.ftitle += ',' + item.label
-						} else {
-							this.ftitle += item.label
+					this.farealist[0].checked = false
+					if (this.ftitleList.length < 3) {
+						item.checked = !item.checked
+						if (item.checked ) {
+							if(this.ftitleList.indexOf(item.label)==-1){
+								this.ftitleList.push(item.label)
+							}
+						} else if (!item.checked) {
+							for (var i = 0; i < this.ftitleList.length; i++) {
+								console.log(this.ftitleList[i])
+								if(this.ftitleList[i]==item.label){
+									this.ftitleList.splice(i,1)
+								}
+							}
 						}
-						this.fchoosearea = this.ftitle
-						console.log(this.fchoosearea)
 					} else {
-						if (this.ftitle.includes(',' + item.label)) {
-							this.ftitle = this.ftitle.replace(',' + item.label, '')
-							this.fchoosearea = this.fchoosearea.replace(',' + item.label, '')
-						} else {
-							let _val = this.ftitle.split(',')
-							let _len = _val.length;
-							if (_len == 1) {
-								this.ftitle = this.ftitle.replace(item.label, '')
-								this.fchoosearea = '请选择区'
-							} else if (_len > 1) {
-								this.ftitle = this.ftitle.replace(item.label + ',', '')
-								this.fchoosearea = this.fchoosearea.replace(item.label + ',', '')
+						if (item.checked) {
+							item.checked = !item.checked
+							for (var i = 0; i < this.ftitleList.length; i++) {
+								if(this.ftitleList[i]==item.label){
+									this.ftitleList.splice(i,1)
+								}
 							}
+						} else {
+							this.$refs.uToast.show({
+								type: 'error',
+								message: "最多选择3个地区",
+							})
 						}
 					}
-				} else {
-					if (item.checked && !this.schoosearea.includes(item.label)) {
-						if (this.stitle) {
-							this.stitle += ',' + item.label
-						} else {
-							this.stitle += item.label
+					this.ftitle=this.ftitleList.toString()
+					this.fchoosearea=this.ftitleList.toString()
+				}else{
+					this.sarealist[0].checked = false
+					if (this.stitleList.length < 3) {
+						item.checked = !item.checked
+						if (item.checked ) {
+							if(this.stitleList.indexOf(item.label)==-1){
+								this.stitleList.push(item.label)
+							}
+						} else if (!item.checked) {
+							for (var i = 0; i < this.stitleList.length; i++) {
+								console.log(this.stitleList[i])
+								if(this.stitleList[i]==item.label){
+									this.stitleList.splice(i,1)
+								}
+							}
 						}
-						this.schoosearea = this.stitle
 					} else {
-						if (this.stitle.includes(',' + item.label)) {
-							this.stitle = this.stitle.replace(',' + item.label, '')
-							this.schoosearea = this.schoosearea.replace(',' + item.label, '')
-						} else {
-							let _val = this.stitle.split(',')
-							let _len = _val.length;
-							if (_len == 1) {
-								this.stitle = this.stitle.replace(item.label, '')
-								this.schoosearea = '请选择区'
-							} else if (_len > 1) {
-								this.stitle = this.stitle.replace(item.label + ',', '')
-								this.schoosearea = this.schoosearea.replace(item.label + ',', '')
+						if (item.checked) {
+							item.checked = !item.checked
+							for (var i = 0; i < this.stitleList.length; i++) {
+								if(this.stitleList[i]==item.label){
+									this.stitleList.splice(i,1)
+								}
 							}
+						} else {
+							this.$refs.uToast.show({
+								type: 'error',
+								message: "最多选择3个地区",
+							})
 						}
 					}
+					this.stitle=this.stitleList.toString()
+					this.schoosearea=this.stitleList.toString()
 				}
+				console.log(this.ftitleList)
+				this.$forceUpdate()
+				//设置面包屑 0发货地 1收货地
+				// if (this.type == 0) {
+				// 	this.farealist[0].checked = false
+				// 	// if(this.ftitleList.indexOf(item.label)==-1){
+				// 	// 	this.ftitleList.push(item.label)
+				// 	// }
+				// 	if (item.checked && !this.fchoosearea.includes(item.label)) {
+				// 		if (this.ftitle) {
+				// 			this.ftitle += ',' + item.label
+							
+				// 		} else {
+				// 			this.ftitle += item.label
+				// 		}
+				// 		this.fchoosearea = this.ftitle
+				// 		console.log(this.fchoosearea)
+				// 	} else {
+				// 		if (this.ftitle.includes(',' + item.label)) {
+				// 			this.ftitle = this.ftitle.replace(',' + item.label, '')
+				// 			this.fchoosearea = this.fchoosearea.replace(',' + item.label, '')
+				// 		} else {
+				// 			let _val = this.ftitle.split(',')
+				// 			let _len = _val.length;
+				// 			if (_len == 1) {
+				// 				this.ftitle = this.ftitle.replace(item.label, '')
+				// 				this.fchoosearea = '请选择区'
+				// 			} else if (_len > 1) {
+				// 				this.ftitle = this.ftitle.replace(item.label + ',', '')
+				// 				this.fchoosearea = this.fchoosearea.replace(item.label + ',', '')
+				// 			}
+				// 		}
+				// 	}
+				// } else {
+				// 	if (item.checked && !this.schoosearea.includes(item.label)) {
+				// 		if (this.stitle) {
+				// 			this.stitle += ',' + item.label
+				// 		} else {
+				// 			this.stitle += item.label
+				// 		}
+				// 		this.schoosearea = this.stitle
+				// 	} else {
+				// 		if (this.stitle.includes(',' + item.label)) {
+				// 			this.stitle = this.stitle.replace(',' + item.label, '')
+				// 			this.schoosearea = this.schoosearea.replace(',' + item.label, '')
+				// 		} else {
+				// 			let _val = this.stitle.split(',')
+				// 			let _len = _val.length;
+				// 			if (_len == 1) {
+				// 				this.stitle = this.stitle.replace(item.label, '')
+				// 				this.schoosearea = '请选择区'
+				// 			} else if (_len > 1) {
+				// 				this.stitle = this.stitle.replace(item.label + ',', '')
+				// 				this.schoosearea = this.schoosearea.replace(item.label + ',', '')
+				// 			}
+				// 		}
+				// 	}
+				// }
 			},
 			changeCity(type) {
 				if (type == 0) {

+ 26 - 13
pages/order/confirmLoading.vue

@@ -134,15 +134,14 @@
 			}
 		},
 		onLoad(options) {
-			that = this
-			// #ifdef APP-PLUS
-			this.getLngLat();
-			// #endif
-			console.log(options)
 			this.id = JSON.parse(decodeURIComponent(options.obj)).id
 			this.detailData.hyCarrierInfo.id = JSON.parse(decodeURIComponent(options.obj)).carrierId
 			this.cyId = JSON.parse(decodeURIComponent(options.obj)).carrierId
 			this.getInfo()
+			
+			console.log(options)
+			
+			
 			// this.detailData = JSON.parse(options.obj) ;
 			// console.log(this.detailData)
 			// CYHT20220317000001
@@ -186,6 +185,9 @@
 				}).then(res => {
 					if (res.code == 200) {
 						this.detailData = res.data
+						// #ifdef APP-PLUS
+						this.getLngLat();
+						// #endif
 						this.$request.baseRequest('get', '/carrierInfo/getHyCarrierInfo', {
 							orderId: this.detailData.id,
 						}).then(res => {
@@ -244,6 +246,7 @@
 				this.detailData.hyCarrierInfo.carNo = e.value //键盘输入值
 			},
 			getLngLat() {
+			var that=this
 				uni.showLoading({
 					title: '获取定位中',
 					mask: true
@@ -278,12 +281,19 @@
 					geocode: true,
 					success: res => {
 						if (res.latitude) {
+							console.log(res,that.detailData,111111)
 							that.detailData.hyCarrierInfo.longitudeLatitude=res.longitude+','+res.latitude
 							that.detailData.hyCarrierInfo.loadingAreaLongitude = res.longitude;
 							that.detailData.hyCarrierInfo.loadingAreaLatitude = res.latitude;
 							that.detailData.hyCarrierInfo.sendCity = that.$helper.filterUrban(res.address.city)
 							that.localtion.city = that.$helper.filterUrban(res.address.city)
+							that.$set(that.detailData,'loadingArea',that.$helper.filterUrban(res.address.district))
+							that.$set(that.detailData,'loadingCity',that.$helper.filterUrban(res.address.city))
 							that.localtion.sendArea = that.$helper.filterUrban(res.address.district)
+							// .loadingCity = that.$helper.filterUrban(res.address.city)
+							that.detailData.loadingLongitude = res.longitude;
+							that.detailData.loadingLatitude = res.latitude;
+							console.log(res,that.detailData,22222)
 							that.$forceUpdate()
 							uni.hideLoading()
 						} else {
@@ -456,6 +466,7 @@
 				// }
 			},
 			confirmClick() {
+				var that=this
 				this.isShowAlert = false
 				if (this.validate()) return
 				//1暂存
@@ -465,7 +476,6 @@
 					delete this.detailData.hyCarrierInfo.sendCity;
 					delete this.detailData.hyCarrierInfo.sendArea;
 				}
-				console.log(this.detailData)
 				uni.showLoading({
 					title: '加载中'
 				})
@@ -482,15 +492,18 @@
 				if (m < 10) {
 					m = "0" + m
 				}
-				if(this.detailData.hyCarrierInfo.loadingDate){
-					this.detailData.hyCarrierInfo.loadingDate = this.detailData.hyCarrierInfo.loadingDate.split(" ")[0] + " " + h + ":" + f + ":" + m
+				var data={
+					loadingImg:this.imgList.toString(),
+					statusFlag:this.detailData.statusFlag,
+					loadingDate:this.detailData.hyCarrierInfo.loadingDate.split(" ")[0] + " " + h + ":" + f + ":" + m,
+					loadingArea:this.detailData.loadingArea,
+					loadingCity:this.detailData.loadingCity,
+					loadingLongitude:this.detailData.loadingLongitude,
+					loadingLatitude:this.detailData.loadingLatitude,
+					id:this.detailData.hyCarrierInfo.id
 				}
-				
-				this.detailData.hyCarrierInfo.statusFlag = this.detailData.statusFlag
-				// this.detailData.hyCarrierInfo.id = this.cyId
-				this.detailData.hyCarrierInfo.loadingImg = this.imgList.toString()
 				console.log("查看id--------",this.detailData.hyCarrierInfo.id)
-				this.$request.baseRequest('post', '/carrierInfo/loadingAdd', this.detailData.hyCarrierInfo).then(res => {
+				this.$request.baseRequest('post', '/carrierInfo/loadingAdd', data).then(res => {
 						if (res.code == 200) {
 							uni.hideLoading()
 							let _title = ''

+ 6 - 2
pages/order/confirmUnloading.vue

@@ -195,6 +195,10 @@
 							that.detailData.carrierInfo.unloadArea = that.$helper.filterUrban(res.address.district)
 							that.localtion.city = that.$helper.filterUrban(res.address.city)
 							that.localtion.sendArea = that.$helper.filterUrban(res.address.district)
+							that.detailData.carrierInfo.unloadingCity = that.$helper.filterUrban(res.address.city)
+							that.detailData.carrierInfo.unloadingArea = that.$helper.filterUrban(res.address.district)
+							that.detailData.carrierInfo.unloadingLongitude = res.longitude;
+							that.detailData.carrierInfo.unloadingLatitude = res.latitude;
 							that.$forceUpdate()
 							uni.hideLoading()
 						} else {
@@ -399,8 +403,8 @@
 								complete() {
 									uni.hideLoading()
 									that.$helper.fUN_AmapLocation.stop({}, result => {
-            console.log('====fUN_AmapLocation定位stop====', JSON.stringify(result));
-        });
+										console.log('====fUN_AmapLocation定位stop====', JSON.stringify(result));
+									});
 									uni.switchTab({
 										url: '/pages/order/index'
 									})