110 lines
2.2 KiB
Vue
110 lines
2.2 KiB
Vue
<template>
|
|
<div class="" >
|
|
<div v-if="isNeedTrace">
|
|
<iframe :src="traceMapUrl" id="map" scrolling="no" frameborder="0" style="width:100%;min-height: 400px;" ></iframe>
|
|
</div>
|
|
<div v-else>未配置</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { getDeviceNoByBillCode } from "@/api/emis/emisTmsMapTrace";
|
|
import { getWaybillDetail} from "@/api/emis/emisWaybill";
|
|
|
|
export default {
|
|
name: "MapTraceView",
|
|
props:{
|
|
billCode:{
|
|
type: String,
|
|
}
|
|
},
|
|
dicts: [],
|
|
data() {
|
|
return {
|
|
reverse: false,
|
|
loading: true,
|
|
isNeedTrace:false,
|
|
showUrl:null,
|
|
deviceNo:null,
|
|
beginTraceDate:null,
|
|
endTraceDate:null,
|
|
};
|
|
},
|
|
computed: {
|
|
traceMapUrl: function () {
|
|
if(this.showUrl==null){
|
|
return "https://lbs.jtrs56.com/showTraceMap?deviceNo";
|
|
}else{
|
|
return this.showUrl;
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
this.initData();
|
|
},
|
|
watch: {
|
|
"billCode": {
|
|
handler (newValue, oldValue) {
|
|
},
|
|
deep: true
|
|
}
|
|
},
|
|
methods: {
|
|
async initData() {
|
|
this.isNeedTrace=false;
|
|
if(this.billCode) {
|
|
let res=await getDeviceNoByBillCode(this.billCode);
|
|
if(res.code==200){
|
|
this.deviceNo=res.data;
|
|
if(this.deviceNo!='-1'){
|
|
this.isNeedTrace=true;
|
|
let resBillDtl=await getWaybillDetail(this.billCode);
|
|
if(resBillDtl.code==200){
|
|
let billDetail=resBillDtl.data;
|
|
this.beginTraceDate=billDetail.sendDate;
|
|
this.endTraceDate=billDetail.signDate
|
|
if(this.endTraceDate==null){
|
|
this.endTraceDate=new Date();
|
|
}
|
|
this.showUrl="https://lbs.jtrs56.com/showTraceMap?deviceNo="+this.deviceNo+"&beginDate="+this.beginTraceDate+"&endDate="+this.endTraceDate;
|
|
}
|
|
}
|
|
}
|
|
|
|
}else{
|
|
this.deviceNo=null;
|
|
}
|
|
},
|
|
|
|
}
|
|
};
|
|
</script>
|
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss">
|
|
|
|
.margin-top{
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.el-descriptions-item__label.is-bordered-label {
|
|
min-width: 80px;
|
|
}
|
|
|
|
.printMeClass {
|
|
font-family: SimHei;
|
|
label {
|
|
font-weight: normal;
|
|
}
|
|
}
|
|
|
|
.siteOrManHighlight {
|
|
color: #00BFFF;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.transferGray{
|
|
color: gray;
|
|
}
|
|
</style>
|