|
|
@@ -773,7 +773,11 @@
|
|
|
</el-table>
|
|
|
</trade-card>
|
|
|
<trade-card :title="$t('landbtn118n.vehicleInformation')">
|
|
|
- <avue-form :option="goodsOptionFormTwo" v-model="goodsForm"></avue-form>
|
|
|
+ <avue-form :option="goodsOptionFormTwo" v-model="goodsForm">
|
|
|
+ <template slot="plateNoLabel" v-if="isMap">
|
|
|
+ <span class="el-button--text" style="cursor: pointer" @click="openTrack2(goodsForm)">车号</span>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
</trade-card>
|
|
|
<span v-if="false">
|
|
|
<containerTitle :title="$t('landbtn118n.vehicleInformation')"></containerTitle>
|
|
|
@@ -1004,6 +1008,9 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<track-playback :dialogVisible="dialogVisible" :lineArr="lineArr" ref="playback"></track-playback>
|
|
|
+ <el-dialog title="实时位置" append-to-body custom-class="dialog_two" :visible.sync="dialogVisible2" lock-scroll width="80%">
|
|
|
+ <div id="container" v-if="dialogVisible2"></div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -1034,6 +1041,7 @@ import { fleetList, generateBill, telephone } from "@/api/landTransportation";
|
|
|
import { getDictionary } from "@/api/system/dictbiz";
|
|
|
import { allCropList, customerList } from "@/api/basicData/customerInformation";
|
|
|
import { contrastList, contrastObj } from "@/util/contrastData";
|
|
|
+import { isProcurement } from "@/api/basicData/configuration";
|
|
|
// goodsOptionFormTwo
|
|
|
export default {
|
|
|
comments: {
|
|
|
@@ -1126,6 +1134,11 @@ export default {
|
|
|
return {
|
|
|
returnButton: Boolean,
|
|
|
dialogVisible: false,
|
|
|
+ dialogVisible2: false,
|
|
|
+
|
|
|
+ map: null,
|
|
|
+ infoWindow: null,
|
|
|
+ marker: null,
|
|
|
lineArr: [],
|
|
|
activeIndex: "1",
|
|
|
KeyBox: 0,
|
|
|
@@ -2410,17 +2423,18 @@ export default {
|
|
|
label: this.$t("land118n.settlementAmount"),
|
|
|
type: "settlementAmount",
|
|
|
index: 10,
|
|
|
- hide:JSON.parse(localStorage.getItem("saber-userInfo")).content.tenant_id=='809700'?false:true,
|
|
|
+ hide: JSON.parse(localStorage.getItem("saber-userInfo")).content.tenant_id == "809700" ? false : true
|
|
|
},
|
|
|
{
|
|
|
// label: '结算时间',
|
|
|
label: this.$t("land118n.settlementTime"),
|
|
|
type: "settlementDate",
|
|
|
index: 11,
|
|
|
- hide:JSON.parse(localStorage.getItem("saber-userInfo")).content.tenant_id=='809700'?false:true,
|
|
|
+ hide: JSON.parse(localStorage.getItem("saber-userInfo")).content.tenant_id == "809700" ? false : true
|
|
|
}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ isMap:false,
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
@@ -2444,6 +2458,11 @@ export default {
|
|
|
this.findObject(this.goodsOptionFormTwo.column, "freightPay").display = false;
|
|
|
this.findObject(this.goodsOptionForm.column, "freightCollect").display = false;
|
|
|
}
|
|
|
+ isProcurement({ param: "is.map" }).then(res => {
|
|
|
+ if (res.data.data == 1) {
|
|
|
+ this.isMap = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
allCropList({
|
|
|
corpType: "GC"
|
|
|
}).then(res => {
|
|
|
@@ -2765,6 +2784,76 @@ export default {
|
|
|
// // console.log(this.lineArr[this.lineArr.length - 1])
|
|
|
// })
|
|
|
},
|
|
|
+
|
|
|
+ openTrack2(row) {
|
|
|
+ location({ plateNo: row.plateNo, tenantId: "234557", color: "2" }).then(res => {
|
|
|
+ this.dialogVisible2 = true;
|
|
|
+ let this_ = this;
|
|
|
+ setTimeout(function() {
|
|
|
+ this_.initMap(res.data.data, row.plateNo);
|
|
|
+ }, 1000);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ markerClick(e) {
|
|
|
+ this.infoWindow.setContent(e.target.content);
|
|
|
+ this.infoWindow.open(this.map, e.target.getPosition());
|
|
|
+ },
|
|
|
+ initMap(data, plateNo) {
|
|
|
+ this.map = null;
|
|
|
+ this.map = new AMap.Map("container", { resizeEnable: true });
|
|
|
+ this.infoWindow = new AMap.InfoWindow({
|
|
|
+ ffset: new AMap.Pixel(0, -30),
|
|
|
+ offset: new AMap.Pixel(0, -30)
|
|
|
+ });
|
|
|
+ let icon = new AMap.Icon({
|
|
|
+ size: new AMap.Size(52, 26), // 图标尺寸
|
|
|
+ image: "http://trade.tubaosoft.com/file/bladex/000000/1123598821738675201/che.png",
|
|
|
+ imageSize: new AMap.Size(52, 26) // 根据所设置的大小拉伸或压缩图片
|
|
|
+ });
|
|
|
+ this.marker = new AMap.Marker({
|
|
|
+ position: data.location,
|
|
|
+ map: this.map,
|
|
|
+ icon: icon,
|
|
|
+ markerMeta: new AMap.Size(28, 28),
|
|
|
+ offset: new AMap.Pixel(-26, -15),
|
|
|
+ autoRotation: true,
|
|
|
+ angle: -15
|
|
|
+ });
|
|
|
+ this.marker.content =
|
|
|
+ '<div style="width: 300px;">' +
|
|
|
+ '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #fff;">' +
|
|
|
+ plateNo +
|
|
|
+ "</p>" +
|
|
|
+ '<p style="padding: 5px 0"><span style="color: #a0a0a0">最后上报时间:</span>' +
|
|
|
+ new Date(Number(data.time) + 8 * 60 * 60 * 1000)
|
|
|
+ .toJSON()
|
|
|
+ .split("T")
|
|
|
+ .join(" ")
|
|
|
+ .substr(0, 19) +
|
|
|
+ "</p>" +
|
|
|
+ '<div style="width: 150px;float: left;">' +
|
|
|
+ '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span>' +
|
|
|
+ (data.speed > 0 ? "行驶中" : "停车") +
|
|
|
+ "</p>" +
|
|
|
+ "</div>" +
|
|
|
+ '<div style="width: 150px;float: right;">' +
|
|
|
+ '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' +
|
|
|
+ data.speed +
|
|
|
+ "km/h</p>" +
|
|
|
+ "</div>" +
|
|
|
+ '<p><span style="color: #a0a0a0">当前位置:</span>' +
|
|
|
+ data.address +
|
|
|
+ "</p>" +
|
|
|
+ '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' +
|
|
|
+ data.location.join(",") +
|
|
|
+ "</p>" +
|
|
|
+ "</div>";
|
|
|
+ this.infoWindow.open(this.map, this.map.getCenter());
|
|
|
+ this.marker.on("click", this.markerClick);
|
|
|
+ this.marker.emit("click", { target: this.marker });
|
|
|
+ this.map.setFitView();
|
|
|
+ },
|
|
|
changeSelect(val) {
|
|
|
for (let item of this.salesmanList) {
|
|
|
if (item.id == val) {
|
|
|
@@ -3627,4 +3716,8 @@ export default {
|
|
|
.single ::v-deep .el-button--mini {
|
|
|
padding: 0 0 !important;
|
|
|
}
|
|
|
+#container {
|
|
|
+ height: 80vh;
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
</style>
|