Ver código fonte

提交陆运

caojunjie 3 anos atrás
pai
commit
51e99ed2ee

+ 4 - 0
src/components/crop-select/main.vue

@@ -33,6 +33,7 @@
         filterable
         clearable
         style="width:100%"
+        @clear="clear"
         :multiple="multiple ? multiple : false"
         :collapse-tags="collapseTags ? collapseTags : false"
         @change="corpChange"
@@ -223,6 +224,9 @@ export default {
       this.$emit("getCorpList", [...this.selectionList])
       this.corpVisible = false;
     },
+    clear(){
+      this.$emit("clear");
+    },
     corpChange(row) {
       if (!this.multiple) {
         this.corpList.forEach(e => {

+ 89 - 1
src/views/landTransportation/motorcadeDriver/index.vue

@@ -101,6 +101,10 @@
               corpType="CD"
           ></crop-select>
         </template>
+        <template slot-scope="{row}" slot="plateNo">
+          <span class="el-button--text" style="cursor: pointer"
+                @click="openTrack(row)">{{ row.plateNo }}</span>
+        </template>
         <template slot-scope="{row,index}" slot="menu">
           <el-button
               type="text"
@@ -192,6 +196,15 @@
         </span>
       </el-dialog>
     </basic-container>
+    <el-dialog
+        title="车辆轨迹"
+        append-to-body
+        custom-class="dialog_two"
+        :visible.sync="dialogVisibleTwo"
+        lock-scroll
+        width="80%">
+      <div id="container"></div>
+    </el-dialog>
   </div>
 </template>
 
@@ -204,6 +217,7 @@ import {
   motorcadeDriver,
   fleetDriverSave, telephone, getAttachment, saveAttached, recordingDetails, changeVehicle
 } from "@/api/landTransportation";
+import {location} from "@/api/gaude";
 
 export default {
   name: "index",
@@ -211,6 +225,10 @@ export default {
     return {
       key: 0,
       query:{},
+      dialogVisibleTwo:false,
+      map: null,
+      infoWindow: null,
+      marker: null,
       formDataList:{},
       optionData: {
         span: 12,
@@ -751,6 +769,7 @@ export default {
     },5000)
   },
   beforeDestroy() {
+    this.map && this.map.destroy();
     clearInterval(this.dispatchACarTimer); //关闭
   },
   methods: {
@@ -957,12 +976,81 @@ export default {
     },
     ToBreak(val) {
       if (val)return val.replace(/\n/g, '<br/>')
-    }
+    },
+    markerClick(e) {
+      this.infoWindow.setContent(e.target.content);
+      this.infoWindow.open(this.map, e.target.getPosition());
+    },
+    openTrack(row){
+      location({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
+        this.dialogVisibleTwo = true
+        let this_ = this
+        setTimeout(function () {
+          this_.initMap(res.data.data, row.plateNo);
+        }, 1000)
+      })
+    },
+    initMap(data, plateNo) {
+      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: 'https://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();
+    },
   }
 }
 </script>
 
 <style lang="scss" scoped>
+#container {
+  height: 80vh;
+  width: 100%;
+}
+::v-deep .el-dialog {
+  margin-top: 5vh !important;
+  margin-bottom: 0 !important;
+}
+
+::v-deep .el-dialog__body {
+  padding: 0 20px 10px 20px !important;
+}
+::v-deep .amap-info-content {
+  padding: 5px 5px 5px 5px !important;
+}
+::v-deep .amap-info-close {
+  right: 10px !important;
+  top: 12px !important;
+}
 .selected{
   color: #1e9fff !important;
 }

+ 26 - 9
src/views/landTransportation/placeAnOrder/detailPage.vue

@@ -266,6 +266,16 @@
               <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="addAddress"
                          style="margin-right: 1.25rem;"></el-button>
             </el-tooltip>
+<!--            <el-tooltip v-else class="item" effect="dark" content="移动" placement="left">-->
+<!--              <div>-->
+<!--                <div class="single">-->
+<!--                  <el-button type="text" icon="el-icon-arrow-up" size="mini"></el-button>-->
+<!--                </div>-->
+<!--                <div class="single">-->
+<!--                  <el-button type="text" icon="el-icon-arrow-down" size="mini"></el-button>-->
+<!--                </div>-->
+<!--              </div>-->
+<!--            </el-tooltip>-->
           </template>
         </el-table-column>
         <el-table-column
@@ -305,6 +315,7 @@
                 :corpType="'GC'"
                 :disabled="goodsForm.status !== 0"
                 v-model="scope.row.corpId"
+                @clear="clear(scope.row)"
                 @getCorpData="(row)=>{withAddress(row,scope)}"/>
           </template>
         </el-table-column>
@@ -566,7 +577,7 @@ export default {
   },
   data() {
     return {
-      returnButton:Boolean,
+      returnButton: Boolean,
       dialogVisible: false,
       lineArr: [],
       activeIndex: '1',
@@ -1509,10 +1520,10 @@ export default {
           //查询业务员
           this.salesmanQuery()
         })
-      } else if (this.id.slice(0, 2) === '首页'||this.id.slice(0, 2) === '台账') {
-        if (this.id.slice(0, 2) === '首页'){
+      } else if (this.id.slice(0, 2) === '首页' || this.id.slice(0, 2) === '台账') {
+        if (this.id.slice(0, 2) === '首页') {
           this.returnButton = true
-        }else {
+        } else {
           this.returnButton = false
         }
         detailDelegationList({id: this.id.slice(2, this.id.length), kind: '1'}).then(res => {
@@ -1544,7 +1555,7 @@ export default {
             this.goodsForm.status = 2
           }
         })
-      }else {
+      } else {
         detailDelegationList({id: this.id, kind: '1'}).then(res => {
           this.goodsForm = res.data.data
           this.tableData = res.data.data.orderAddressList
@@ -1583,11 +1594,11 @@ export default {
           businessType: "出口",
           shippingMode: "集装箱",
           status: 0,
-          salesman:JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id,
+          salesman: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id,
           belongCompany: res.data.data ? res.data.data.belongCompany : '',
           bsDate: new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19)//获取当天时间并格式化
         }
-        this.salesmanQuery('',true)
+        this.salesmanQuery('', true)
       })
       this.entrustList = []
     }
@@ -1628,10 +1639,10 @@ export default {
       });
     },
     //查询业务员
-    salesmanQuery(realName,type) {
+    salesmanQuery(realName, type) {
       getSalesman({realName: realName, userExt: this.goodsForm.corpId}).then(res => {
         this.salesmanList = res.data.data
-        if (type){
+        if (type) {
           this.changeSelect(this.goodsForm.salesman)
         }
       })
@@ -2095,6 +2106,9 @@ export default {
       //查询业务员
       this.salesmanQuery()
     },
+    clear(row) {
+      row.corpName = ''
+    },
     //选择地址客户带出地址
     withAddress(row, scope) {
       this.$set(this.tableData[scope.$index], 'contacts', row.attn)
@@ -2149,4 +2163,7 @@ export default {
   padding: 10px 15px;
   font-size: 14px;
 }
+.single ::v-deep .el-button--mini{
+  padding: 0 15px;
+}
 </style>

+ 1 - 1
src/views/landTransportation/placeAnOrder/index.vue

@@ -97,7 +97,7 @@
                 </div>
                 <div class="card-content">
                   <span class="card-content-num" :class="activeName === '4'?'selected':''">{{ totalData.four }}</span>
-                  <span class="card-content-text" :class="activeName === '4'?'selected':''">工单关闭</span>
+                  <span class="card-content-text" :class="activeName === '4'?'selected':''">关闭</span>
                 </div>
               </div>
             </div>

+ 0 - 2
src/views/wel/home/landTransportation/components/sales-trend.vue

@@ -452,8 +452,6 @@ export default {
         //   }, 100)
         // })
         location({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
-          console.log(res.data.data)
-          console.log(this.lineArr[this.lineArr.length - 1])
           this.dialogVisible = true
           let this_ = this
           setTimeout(function () {