|
@@ -210,9 +210,6 @@
|
|
|
console.log(res);
|
|
|
});
|
|
|
this.auth()
|
|
|
- // this.detailData = JSON.parse(options.obj) ;
|
|
|
- // console.log(this.detailData)
|
|
|
- // CYHT20220317000001
|
|
|
},
|
|
|
onHide() {
|
|
|
uni.removeStorageSync(
|
|
@@ -232,8 +229,8 @@
|
|
|
},
|
|
|
methods: {
|
|
|
auth() { //授权
|
|
|
- console.log("appid:" + this.appId + "安全码:" + this.appSecurity + "发送代码:" + this.enterpriseSenderCode)
|
|
|
- let that = this
|
|
|
+ console.log("appid:" + this.appId + "安全码:" + this.appSecurity + "发送代码:" + this.enterpriseSenderCode+"环境"+this.environment)
|
|
|
+ var that = this
|
|
|
sdkwx.auth(this.appId, this.appSecurity, this.enterpriseSenderCode, this.environment, function(res) {
|
|
|
if (res.type == "onSuccess") {
|
|
|
//成功
|
|
@@ -243,17 +240,18 @@
|
|
|
//失败
|
|
|
var errorCode = res.data.errorCode; //错误码
|
|
|
var errorMsg = res.data.errorMsg; //错误描述
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "管局授权失败-"+errorMsg
|
|
|
+ })
|
|
|
console.log("授权失败")
|
|
|
console.log(res)
|
|
|
}
|
|
|
- // uni.showModal({
|
|
|
- // content: JSON.stringify(res)
|
|
|
- // });
|
|
|
});
|
|
|
},
|
|
|
- start() { //开启定位
|
|
|
+ start(val) { //开启定位
|
|
|
+ var that = this
|
|
|
//车牌号 //司机姓名 //备注 //运单信息列表
|
|
|
- console.log(this.detailData, "行政区划分")
|
|
|
this.shippingNoteInfos[0].shippingNoteNumber = this.detailData.orderNo //运单号
|
|
|
this.shippingNoteInfos[0].serialNumber = "0000" //分单号
|
|
|
this.shippingNoteInfos[0].startCountrySubdivisionCode = this.detailData.publishTaskInfo
|
|
@@ -280,18 +278,11 @@
|
|
|
|
|
|
//}],//运单信息列表,一辆车运单数最大支持数为 10
|
|
|
var remark = "测试"; //备注
|
|
|
- let that = this
|
|
|
- console.log("start this.shippingNoteInfos")
|
|
|
- console.log(this.shippingNoteInfos)
|
|
|
var param = {}
|
|
|
param.carNo = this.detailData.carNo
|
|
|
param.driverName = this.firstAuthentication.driverName
|
|
|
param.remark = remark
|
|
|
param.shippingNoteInfos = this.shippingNoteInfos
|
|
|
- // uni.setStorageSync("sdkStartParam",param)
|
|
|
- // uni.setStorageSync("sdkStartParamOrderNum",this.detailData.orderNo)
|
|
|
- // this.$helper.sdkStart(this.detailData.carNo, this.firstAuthentication.driverName, remark, this.shippingNoteInfos)
|
|
|
- console.log("dsjaokfljdof",this.shippingNoteInfos)
|
|
|
sdkwx.start(this.detailData.carNo, this.firstAuthentication.driverName, remark, this.shippingNoteInfos,
|
|
|
function(res) {
|
|
|
if (res.type == "onSuccess") {
|
|
@@ -299,34 +290,28 @@
|
|
|
console.log("开启定位成功!!!")
|
|
|
console.log(res)
|
|
|
var shippingNoteInfos = res.data[0]; //运单信息列表
|
|
|
- console.log(shippingNoteInfos, "sdassss")
|
|
|
if (shippingNoteInfos) {
|
|
|
let dateTtime = Number(shippingNoteInfos.interval + 1000)
|
|
|
console.log("开始定时", dateTtime)
|
|
|
that.send()
|
|
|
- // that.timer = setTimeout(() => {
|
|
|
- // console.log("定时")
|
|
|
- // that.send()
|
|
|
- // }, dateTtime);
|
|
|
}
|
|
|
+ that.affirm(val)//管局上报成功后提交
|
|
|
} else if (res.type == "onFailure") {
|
|
|
//失败
|
|
|
console.log("开启定位失败!!!")
|
|
|
console.log(res)
|
|
|
var errorCode = res.data.errorCode; //错误码
|
|
|
var errorMsg = res.data.errorMsg; //错误描述
|
|
|
+ uni.hideLoading()
|
|
|
that.$refs.uToast.show({
|
|
|
type: 'error',
|
|
|
- message: errorMsg
|
|
|
+ message: "管局上报-"+errorMsg
|
|
|
})
|
|
|
that.timer = setTimeout(() => {
|
|
|
console.log("定时")
|
|
|
that.send()
|
|
|
}, 915204);
|
|
|
}
|
|
|
- // uni.showModal({
|
|
|
- // content:JSON.stringify(res)
|
|
|
- // });
|
|
|
});
|
|
|
},
|
|
|
send() { //发送定位
|
|
@@ -751,47 +736,11 @@
|
|
|
return true
|
|
|
}
|
|
|
},
|
|
|
- confirmClick() {
|
|
|
- uni.removeStorageSync('contractdata')
|
|
|
+ affirm(data){
|
|
|
+ console.log("提交",data)
|
|
|
var that = this
|
|
|
- this.isShowAlert = false
|
|
|
- //1暂存
|
|
|
- if (this.detailData.statusFlag == 1) {
|
|
|
- delete this.detailData.hyCarrierInfo.loadingAreaLongitude;
|
|
|
- delete this.detailData.hyCarrierInfo.loadingAreaLatitude;
|
|
|
- delete this.detailData.hyCarrierInfo.sendCity;
|
|
|
- delete this.detailData.hyCarrierInfo.sendArea;
|
|
|
- }
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中'
|
|
|
- })
|
|
|
- let time = new Date() //装车时间 去当前时间的时分秒
|
|
|
- let h = time.getHours();
|
|
|
- if (h < 10) {
|
|
|
- h = "0" + h
|
|
|
- }
|
|
|
- let f = time.getMinutes();
|
|
|
- if (f < 10) {
|
|
|
- f = "0" + f
|
|
|
- }
|
|
|
- let m = time.getSeconds();
|
|
|
- if (m < 10) {
|
|
|
- m = "0" + 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,
|
|
|
- transportationDuration: this.detailData.transportationDuration
|
|
|
- }
|
|
|
-
|
|
|
- // console.log("查看id--------",this.detailData.hyCarrierInfo.id)
|
|
|
this.$request.baseRequest('post', '/carrierInfo/loadingAdd', data).then(res => {
|
|
|
+ console.log("提交状态",res)
|
|
|
if (res.code == 200) {
|
|
|
uni.hideLoading()
|
|
|
let _title = ''
|
|
@@ -799,7 +748,7 @@
|
|
|
_title = '暂存成功!'
|
|
|
return
|
|
|
} else {
|
|
|
- that.start() //开始授权并开始定位
|
|
|
+ // that.start() //开始授权并开始定位
|
|
|
_title = '提交成功!'
|
|
|
}
|
|
|
that.$helper.fUN_AmapLocation.start({
|
|
@@ -844,13 +793,14 @@
|
|
|
that.$helper.gjList = []
|
|
|
})
|
|
|
.catch(res => {
|
|
|
+ console.log("0",res.message)
|
|
|
uni.$u.toast(res.message);
|
|
|
});
|
|
|
}
|
|
|
//判断缓存数据条数,超过reportInterval时清空缓存,重新存入缓存
|
|
|
}
|
|
|
);
|
|
|
-
|
|
|
+
|
|
|
this.$refs.uToast.show({
|
|
|
type: 'success',
|
|
|
message: _title,
|
|
@@ -861,12 +811,58 @@
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
+ console.log("1",res.message)
|
|
|
uni.$u.toast(res.message);
|
|
|
}
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
+ }).catch(res => {
|
|
|
+ console.log("2",res.message)
|
|
|
uni.$u.toast(res.message);
|
|
|
});
|
|
|
+ },
|
|
|
+ confirmClick() {
|
|
|
+ uni.removeStorageSync('contractdata')
|
|
|
+ var that = this
|
|
|
+ this.isShowAlert = false
|
|
|
+ //1暂存
|
|
|
+ if (this.detailData.statusFlag == 1) {
|
|
|
+ delete this.detailData.hyCarrierInfo.loadingAreaLongitude;
|
|
|
+ delete this.detailData.hyCarrierInfo.loadingAreaLatitude;
|
|
|
+ delete this.detailData.hyCarrierInfo.sendCity;
|
|
|
+ delete this.detailData.hyCarrierInfo.sendArea;
|
|
|
+ }
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
+ let time = new Date() //装车时间 去当前时间的时分秒
|
|
|
+ let h = time.getHours();
|
|
|
+ if (h < 10) {
|
|
|
+ h = "0" + h
|
|
|
+ }
|
|
|
+ let f = time.getMinutes();
|
|
|
+ if (f < 10) {
|
|
|
+ f = "0" + f
|
|
|
+ }
|
|
|
+ let m = time.getSeconds();
|
|
|
+ if (m < 10) {
|
|
|
+ m = "0" + 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,
|
|
|
+ transportationDuration: this.detailData.transportationDuration
|
|
|
+ }
|
|
|
+ if (that.detailData.statusFlag == 1) {//暂存
|
|
|
+ console.log("暂存")
|
|
|
+ this.affirm(data)
|
|
|
+ } else {//提交
|
|
|
+ this.start(data)//先调用管局start
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
}
|