luobang 3 jaren geleden
bovenliggende
commit
8ee35dbf68

+ 1 - 1
build/utils.js

@@ -18,7 +18,7 @@ const devPathSrc = path.resolve(__dirname, "../../../src"); // node_modules应
 // let devModules = ['index','inward']
 // let devModules = ['index','TMS']
 // let devModules = ["index", "appoint", "sale", "statisticalReport"];
-let devModules = ["index", "statisticalReport"];
+let devModules = ["all"];
 // let devModules = ['index','statisticalReport','inward']
 if (pathSrc.indexOf("node_modules") > -1) {
   devModules = require("../../../cors.js").devModules;

+ 2 - 2
config/index.js

@@ -65,8 +65,8 @@ let proxyTable = {
   },
   // 所有数据的请求域名地址
   "/api/v1": {
-    target: "http://localhost:8080",
-    // target: "http://192.168.1.103:8080",
+    target: "http://172.16.33.166:80",
+    // target: "http://192.168.1.105:8080",
     // target:"http://localhost:8019",
     ws: true,
     pathRewrite: {

+ 18 - 12
src/views/ADMINISTRATORS/router/index.js

@@ -1,29 +1,35 @@
-import Vue from 'vue'
-import Router from 'vue-router'
-import routerBefore from '@/config/routerBefore.js'
+import Vue from "vue";
+import Router from "vue-router";
+import routerBefore from "@/config/routerBefore.js";
 // 主要
-import main from '@/components/main.vue'
+import main from "@/components/main.vue";
 // 系统配置管理
-import ADMINISTRATORS1 from '../components/ADMINISTRATORS1.vue'
+// import ADMINISTRATORS1 from "../components/ADMINISTRATORS1.vue";
 
-Vue.use(Router)
+Vue.use(Router);
 
 const constantRouterMap = [
   {
-    path: '/',
-    name: 'main',
-    meta: {title: '首页', code: 'xtpzgl'},
+    path: "/",
+    name: "main",
+    meta: { title: "首页", code: "xtpzgl" },
     component: main,
-    redirect: {name: 'ADMINISTRATORS1'},
+    redirect: { name: "ADMINISTRATORS1" },
     children: [
-      {path: 'ADMINISTRATORS1', name: 'ADMINISTRATORS1', meta: {code: 'xtpzgl-jggl'}, component: ADMINISTRATORS1}
+      {
+        path: "ADMINISTRATORS1",
+        name: "ADMINISTRATORS1",
+        meta: { code: "xtpzgl-jggl" },
+        component: () =>
+          import("@/views/ADMINISTRATORS/components/ADMINISTRATORS1")
+      }
     ]
   }
 ];
 
 const router = new Router({
   routes: constantRouterMap
-})
+});
 //  before
 routerBefore(router, constantRouterMap);
 

+ 216 - 229
src/views/RMS/components/addPersonnel.vue

@@ -2,50 +2,50 @@
   <!-- 添加人员信息 -->
   <div class="addWagonLoad">
     <PageTitle>返回</PageTitle>
-    <div class="form-box" style="margin-right: 10rem">
-      <dil-form :formId="325" v-model="form1" ref="from1"></dil-form>
-    </div>
-
-    <div class="department">
-      <div class="department2">
-        <span>二级部门:</span>
-        <el-select v-model="value1" placeholder="请选择" @change="onchange1">
-          <el-option
-            v-for="(item, i) in options1"
-            :key="i"
-            :label="item.label"
-            :value="item.value"
-          >
-          </el-option>
-        </el-select>
+     <div class="form-box" style="margin-right: 10rem">
+        <dil-form :formId="325" v-model="form1" ref="from1"></dil-form>
       </div>
-      <div class="department3">
-        <span>三级部门:</span>
-        <el-select v-model="value2" placeholder="请选择" @change="onchange2">
-          <el-option
-            v-for="(item, i) in options2"
-            :key="i"
-            :label="item.label"
-            :value="item.value"
-          >
-          </el-option>
-        </el-select>
+
+      <div class="department">
+        <div class="department2">
+                <span>二级部门:</span>
+                <el-select v-model="value1" placeholder="请选择" @change="onchange1">
+                    <el-option
+                    v-for="(item,i) in options1"
+                    :key="i"
+                    :label="item.label"
+                    :value="item.value"
+                    >
+                    </el-option>
+                </el-select>
+            </div>
+            <div class="department3">
+                <span>三级部门:</span>
+                <el-select v-model="value2" placeholder="请选择" @change="onchange2">
+                    <el-option
+                        v-for="(item,i) in options2"
+                        :key="i"
+                        :label="item.label"
+                        :value="item.value"
+                    >
+                    </el-option>
+                </el-select>
+            </div>
       </div>
-    </div>
-    <div>
-      <div class="role">
-        <span>赋权角色:</span>
-        <el-select v-model="value3" placeholder="请选择">
-          <el-option
-            v-for="(item, i) in options3"
-            :key="i"
-            :label="item.roleName"
-            :value="item.roleId"
-          >
-          </el-option>
-        </el-select>
+      <div>
+        <div class="role">
+                <span>赋权角色:</span>
+                <el-select v-model="value3" placeholder="请选择">
+                    <el-option
+                        v-for="(item,i) in options3"
+                        :key="i"
+                        :label="item.roleName"
+                        :value="item.roleId"
+                    >
+                    </el-option>
+                </el-select>
+            </div>
       </div>
-    </div>
 
     <div class="button-box">
       <el-button @click="cancel">取消</el-button>
@@ -62,46 +62,46 @@ export default {
   data() {
     return {
       form1: {
-        personnelJobNumber: "",
-        personnelName: "",
-        personnelPost: "",
-        personnelWorkshopid: "",
-        shipperId: "",
-        personnelShifts: "",
-        personnelTeam: ""
+        personnelJobNumber : '',
+        personnelName : '',
+        personnelPost : '',
+        personnelWorkshopid : '',
+        shipperId : '',
+        personnelShifts : '',
+        personnelTeam : ''
       },
       value: undefined,
       //新增用户的SSO主键
-      personnelSsoId: "",
+      personnelSsoId:'',
       //token
       token: null,
       //二级部门
-      options1: [],
+      options1:[],
       //选中的二级部门名称
-      value1: "",
+      value1:'',
       //选中的二级部门机构ID和机构编码
-      map1: {
-        shipperOrgCode: "",
-        shipperSsoId: ""
+      map1:{
+          shipperOrgCode : '',
+          shipperSsoId : ''
       },
       // 三级部门
-      options2: [],
+      options2:[],
       // 选中的三级部门名称
-      value2: "",
+      value2:'',
       //选中的三级部门机构ID和机构编码
-      map2: {
-        shipperOrgCode: "",
-        shipperSsoId: ""
+      map2:{
+          shipperOrgCode : '',
+          shipperSsoId : ''
       },
       // 角色
-      options3: [],
+      options3:[],
       // 选中的角色名称
-      value3: "",
+      value3:'',
       // 选中的角色ID
-      roleId: ""
+      roleId:''
     };
   },
-  created() {
+  created(){
     this.token = getCookie("accessToken");
   },
   mounted() {
@@ -109,217 +109,204 @@ export default {
     this.initialization();
   },
   methods: {
-    initialization() {
-      //初始化选择二级机构
-      this.axios.get("/api/v1/rms/getSecondShipper").then(res => {
-        this.options1 = res.data.data;
-      });
-      //初始化角色
-      const formData = new FormData();
-      this.$store.dispatch("system/rolesManage/list", formData).then(res => {
-        var roleList = [];
-        roleList = res.data;
-        roleList.forEach((item, i) => {
-          if (item.roleId != "superadmin") {
-            this.options3.push(item);
-          }
-        });
-        // this.options3 = res.data;
-      });
-    },
-    onchange1(val) {
-      //  查询选中的二级机构下的三级机构
-      this.value2 = "";
-      this.axios
-        .get("/api/v1/rms/getThirdShipper?shipperId=" + val)
-        .then(res => {
-          this.options2 = res.data.data;
-        });
-      //获取二级部门的机构ID和机构编码
-      this.axios
-        .post("/api/v1/rms/getShipperMap?shipperId=" + val)
-        .then(res => {
-          this.map1 = res.data.data;
-        });
-    },
-    onchange2(val) {
-      //获取三级部门的机构ID和机构编码
-      this.axios
-        .post("/api/v1/rms/getShipperMap?shipperId=" + val)
-        .then(res => {
-          this.map2 = res.data.data;
-        });
-    },
+     initialization(){
+       //初始化选择二级机构
+         this.axios.get('/api/v1/rms/getSecondShipper').then((res)=>{
+             this.options1 = res.data.data;
+         })
+         //初始化角色
+        const formData = new FormData();
+        this.$store.dispatch('system/rolesManage/list',formData)
+        .then((res)=>{
+          var roleList = [];
+          roleList=res.data;
+          roleList.forEach((item,i)=>{
+              if(item.roleId!='superadmin'){
+                this.options3.push(item);
+              }
+          })
+          // this.options3 = res.data;
+        })
+     },
+     onchange1(val){
+            //  查询选中的二级机构下的三级机构
+             this.value2 = '';
+             this.axios.get('/api/v1/rms/getThirdShipper?shipperId='+val).then((res)=>{
+             this.options2 = res.data.data;    
+         })
+         //获取二级部门的机构ID和机构编码
+         this.axios.post('/api/v1/rms/getShipperMap?shipperId='+val).then((res)=>{
+             this.map1 = res.data.data;
+         })
+     },
+     onchange2(val){
+         //获取三级部门的机构ID和机构编码
+         this.axios.post('/api/v1/rms/getShipperMap?shipperId='+val).then((res)=>{
+             this.map2 = res.data.data; 
+         })
+     },
 
-    //确定人员新增
-    makeSure() {
+     //确定人员新增
+     makeSure() {
       //初始化用户信息
       let userInfo = {
-        orgCode: "",
-        orgName: "",
-        orgId: ""
+        orgCode : '',
+        orgName : '',
+        orgId : '',
       };
       //该用户没有三级部门
-      if (this.options2.length == 0) {
-        userInfo = {
-          userName: this.form1.personnelName,
-          userCode: this.form1.personnelJobNumber,
-          orgCode: this.map1.shipperOrgCode,
-          orgName: this.value1,
-          orgId: this.map1.shipperSsoId,
-          // mobile : '13500000011',
-          // email : '123456789@qq.com',
-          groupId: "506514577756917769",
-          companyId: "713710108567277568"
-        };
-        //该用户有三级部门
-      } else {
+      if(this.options2.length==0){
+      userInfo = {
+        userName : this.form1.personnelName,
+        userCode : this.form1.personnelJobNumber,
+        orgCode : this.map1.shipperOrgCode,
+        orgName : this.value1,
+        orgId : this.map1.shipperSsoId,
+        // mobile : '13500000011',
+        // email : '123456789@qq.com',
+        groupId : '506514577756917769',
+        companyId : '713710108567277568'
+      }
+      //该用户有三级部门
+      }else{
         userInfo = {
-          userName: this.form1.personnelName,
-          userCode: this.form1.personnelJobNumber,
-          orgCode: this.map2.shipperOrgCode,
-          orgName: this.value1,
-          orgId: this.map2.shipperSsoId,
-          // mobile : '13500000011',
-          // email : '123456789@qq.com',
-          groupId: "506514577756917769",
-          companyId: "713710108567277568"
-        };
+        userName : this.form1.personnelName,
+        userCode : this.form1.personnelJobNumber,
+        orgCode : this.map2.shipperOrgCode,
+        orgName : this.value1,
+        orgId : this.map2.shipperSsoId,
+        // mobile : '13500000011',
+        // email : '123456789@qq.com',
+        groupId : '506514577756917769',
+        companyId : '713710108567277568'
+      }
       }
-      //先新增SSO中的用户
+       //先新增SSO中的用户
       const formData = new FormData();
-
-      Object.keys(userInfo).forEach(key => {
-        formData.append(key, userInfo[key]);
+      
+      Object.keys(userInfo).forEach((key) => {
+      formData.append(key, userInfo[key]);
       });
       //判断数据是否都填了
-      if (
-        this.form1.personnelJobNumber == "" ||
-        this.form1.personnelPost == "" ||
-        this.form1.personnelName == "" ||
-        // RmsPersonnel.personnelWorkshopid==null ||
-        this.form1.shipperId == "" ||
-        this.form1.personnelShifts == "" ||
-        this.form1.personnelTeam == "" ||
-        this.form1.ConcatTelephone == "" ||
-        userInfo.orgName == "" ||
-        userInfo.orgCode == "" ||
-        userInfo.orgId == "" ||
-        this.value3 == ""
-      ) {
-        this.$message.error("存在空值!");
-      } else {
-        //判断RMS_PERSONNEL表中是否存在该人员信息,存在提示存在,否则开始赋权新增
-        this.axios
-          .post(
-            "/api/v1/rms/isInHere?personnelJobNumber=" +
-              this.form1.personnelJobNumber
-          )
-          .then(res => {
-            console.log("res", res);
-            if (res.data == 0) {
-              this.$message.error("新增失败,该账号已存在!");
-            } else {
-              //开始赋权新增
-              //新增用户表
-              this.$store
-                .dispatch("system/usersManage/addUser", formData)
-                .then(res => {
-                  //console.log("role",res)
-                  //保存权限表中的用户主键Id
-                  this.personnelSsoId = res.data.userId;
-                  //再新增RMS_PERSONNEL表信息
-                  let map1 = {
-                    personnelJobNumber: this.form1.personnelJobNumber,
-                    personnelPost: this.form1.personnelPost,
-                    personnelName: this.form1.personnelName,
-                    personnelDepartmentId: this.form1.shipperId,
-                    // personnelWorkshopid : this.form1.personnelWorkshopid,
-                    personnelShifts: this.form1.personnelShifts,
-                    personnelTeam: this.form1.personnelTeam,
-                    personnelSsoId: this.personnelSsoId,
-                    //联系电话
-                    ConcatTelephone: this.form1.ConcatTelephone,
-                    userId: getCookie("userId")
-                  };
-                  //  console.log("rmsPersonnel",rmsPersonnel)
-                  this.axios
-                    .post("/api/v1/rms/addPersonnel", map1)
-                    .then(res => {
-                      if (res.data.code == 200) {
+      if(
+            this.form1.personnelJobNumber =='' ||
+            this.form1.personnelPost =='' ||
+            this.form1.personnelName =='' ||
+            // RmsPersonnel.personnelWorkshopid==null ||
+            this.form1.shipperId=='' ||
+            this.form1.personnelShifts=='' ||
+            this.form1.personnelTeam=='' ||
+            this.form1.ConcatTelephone==''||
+            userInfo.orgName=='' ||
+            userInfo.orgCode=='' ||
+            userInfo.orgId=='' ||
+            this.value3==''
+          ){
+              this.$message.error("存在空值!");
+      }else{
+      //判断RMS_PERSONNEL表中是否存在该人员信息,存在提示存在,否则开始赋权新增
+      this.axios.post('/api/v1/rms/isInHere?personnelJobNumber='+this.form1.personnelJobNumber)
+      .then((res)=>{
+        console.log("res",res);
+        if(res.data==0){
+          this.$message.error("新增失败,该账号已存在!");
+        }else{
+          //开始赋权新增
+          //新增用户表
+          this.$store.dispatch('system/usersManage/addUser',formData)
+          .then((res)=>{
+              //console.log("role",res)
+              //保存权限表中的用户主键Id
+              this.personnelSsoId = res.data.userId;
+              //再新增RMS_PERSONNEL表信息
+              let map1 = {
+                personnelJobNumber : this.form1.personnelJobNumber,
+                personnelPost : this.form1.personnelPost,
+                personnelName : this.form1.personnelName,
+                personnelDepartmentId : this.form1.shipperId,
+                // personnelWorkshopid : this.form1.personnelWorkshopid,
+                personnelShifts : this.form1.personnelShifts,
+                personnelTeam : this.form1.personnelTeam,
+                personnelSsoId : this.personnelSsoId,
+                //联系电话
+                ConcatTelephone : this.form1.ConcatTelephone,
+                userId: getCookie("userId"),
+              }
+              //  console.log("rmsPersonnel",rmsPersonnel)
+                  this.axios.post('/api/v1/rms/addPersonnel',map1)
+                  .then((res)=>{
+                        if (res.data.code == 200) {
                         this.$message({
                           type: "success",
-                          message: "新增成功!"
+                          message: "新增成功!",
                         });
                         // this.$refs.table.refreshData();
                         //最后新增角色赋权表
-                        this.axios
-                          .post(
-                            "pass/v1/sysuserroles/addUserroles?userId=" +
-                              this.personnelSsoId +
-                              "&userCode=" +
-                              this.form1.personnelJobNumber +
-                              "&roleId=" +
-                              this.value3
-                          )
-                          .then(res => {
+                          this.axios.post('pass/v1/sysuserroles/addUserroles?userId='
+                          +this.personnelSsoId+'&userCode='+this.form1.personnelJobNumber+'&roleId='+this.value3)
+                          .then((res)=>{
                             // console.log("success")
-                            // this.$router.go(-1);
-                          });
+                              this.$router.go(-1);
+                          })
+
                       } else {
                         this.$message.error("新增失败,可能存在重复!");
                       }
                       // this.$refs['table'].resetField();
-                    });
-                }); //end
-            }
-          });
-      } //else
+                  })
+
+          });//end
+
+        }
+      });
+      
+      }//else
+      
     },
     // 取消
     cancel() {
       this.$router.go(-1);
-    }
-  }
+    },
+  },
 };
 </script>
-<style lang="scss">
-.button-box {
-  display: flex;
-  justify-content: center;
-  margin-top: 2rem;
-  .el-button {
-    width: 80px;
-    margin-right: 10px;
+<style lang='scss' >
+ .button-box{
+    display: flex;
+    justify-content: center;
+    margin-top: 2rem;
+    .el-button{
+      width: 80px;
+      margin-right: 10px;
+    }
   }
-}
-.form-box {
+.form-box{
   display: flex;
   justify-content: center;
-  .el-form-item {
+  .el-form-item{
     display: flex;
     justify-content: center;
-    .el-form-item__label {
+    .el-form-item__label{
       display: flex;
       align-items: center;
     }
-    .el-form-item__content {
-      .el-input {
-        .el-input__inner {
+    .el-form-item__content{
+      .el-input{
+        .el-input__inner{
           width: 250px;
         }
       }
     }
   }
 }
-.department {
+.department{
   display: flex;
   justify-content: center;
-  .department3 {
+  .department3{
     margin-left: 2rem;
   }
 }
-.role {
+.role{
   display: flex;
   justify-content: center;
   margin-top: 2rem;

+ 0 - 19
src/views/TMS/components/importedShip/addLoadShip.vue

@@ -209,25 +209,6 @@ export default {
       //   this.$message.error("存在空值!");
       // else if (!isNumber(val)) this.$message.warning("实装数量必须为数字!");
       // else
-      this.axios
-        .post("/api/v1/tms/addLoadShip", {
-          mapVal: mapVal,
-          rowMap: this.rowMap
-        })
-        .then(res => {
-          if (res.data.code == 200) {
-            this.$message({
-              type: "success",
-              message: "新增成功!"
-            });
-            this.$router.go(-1);
-          } else if (res.data.code == 201) {
-            this.$message.warning(res.data.data);
-          } else {
-            this.$message.error("新增失败!");
-          }
-          this.$refs["table"].resetField();
-        });
     },
     handleSelect(item) {
       console.log(item);

+ 1 - 1
src/views/TMS/components/importedShip/addShipmentInstructions.vue

@@ -80,7 +80,7 @@ export default {
         this.$set(
           this.form1,
           "batchId",
-          selection.resultForeignShipName + selection.materialName
+          selection.resultForeignShipName +"-"+selection.materialName+"-" +selection.infactoryShipName
         );
         this.batchId = selection.batchId;
       }

+ 0 - 2
src/views/TMS/components/importedShip/shipLocation.vue

@@ -208,8 +208,6 @@ export default {
         });
     },
     click(row) {
-      let locationRouteTime = sjTime(row.locationRouteTime);
-      row.locationRouteTime = locationRouteTime;
       this.axios.post("/api/v1/tms/updateShipLocation", row).then(res => {
         if (res.data.code == "200") {
           this.$message({

+ 5 - 1
src/views/appoint/components/ship/modifyDeliveryAttroney.vue

@@ -25,6 +25,7 @@ export default {
       form1: {},
       value2: undefined,
       value3: undefined,
+      batchInfactoryId:null,
     };
   },
   mounted() {
@@ -39,7 +40,9 @@ export default {
         )
         .then((res) => {
           res.data.data.forEach((e) => {
+            this.batchInfactoryId=e.batchInfactoryId;
             this.form1 = e;
+            console.log(this.form1.batchId);
           });
         });
     },
@@ -52,7 +55,8 @@ export default {
       let AmsshipDeliveryAttorney = {
         resultId: this.$route.params.attorneyId,
         portId: this.form1.portId,
-        attorneyContactTelephone: this.form1.attorneyContactTelephone,
+        batchId:this.batchInfactoryId,
+        attorneyContactTelephone:this.form1.attorneyContactTelephone,
         attorenyPickupIdcard: this.form1.attorenyPickupIdcard,
         attorneyPickupContactPerson: this.form1.attorneyPickupContactPerson,
         downSwimPortId: this.form1.downSwimPortId,

+ 3 - 3
src/views/appoint/components/ship/modifyDeliveryNotice.vue

@@ -102,7 +102,7 @@
       label-width="80px"
       style="margin-left: 450px; display: flex"
     >
-      <el-form-item label="上传货权转移附件">
+      <el-form-item label="上传货权转移图片">
         <el-upload
           class="upload-demo"
           style="width: 270px"
@@ -119,7 +119,7 @@
           <el-input
             class="shippingCertificate"
             style="width: 270px; display: flex"
-            placeholder="请选择货权转移附件(必填项,可支持重新上传)"
+            placeholder="请选择货权转移图片(必填项,可支持重新上传)"
             v-model="shippingCertificate"
             disabled
           >
@@ -136,7 +136,7 @@
             "
             @click="upCLick(1)"
           >
-            点击上传附件</el-button
+            点击上传图片</el-button
           >
         </el-upload>
       </el-form-item>

+ 6 - 37
src/views/sale/components/offSiteTransportation/checkGPS.vue

@@ -2,14 +2,6 @@
   <div class="container">
     <div id="amap-container"></div>
     <div class="controller">
-      <div class="btnx">
-        <el-button type="primary" class="" @click="openInfo"
-          >打开信息窗体</el-button
-        >
-        <el-button type="primary" class="" @click="closeinfo"
-          >关闭信息窗口</el-button
-        >
-      </div>
       <div class="in_transit_information">
         <span class="item_details">车牌号:</span>
         <el-input
@@ -155,7 +147,6 @@ import { sjTime, stringToDate } from "@/utils/sharedJsFile";
 import Slider from "./slider.vue";
 Vue.use(Slider);
 import Vue from "vue";
-var infoWindow;
 export default {
   name: "PathView",
   setup() {
@@ -448,8 +439,11 @@ export default {
         if (status === "complete" && result.info === "OK") {
           that.endPointName = result.regeocode.formattedAddress;
           setInterval(
+            //设置自定义窗体
             that.initCustomMarkes(
               that.carNumber,
+              that.formatDate(that.time[0],"yyyy-MM-dd")+"至"+that.formatDate(that.time[1],"yyyy-MM-dd")+
+              "<br/>" +
               "起点:" +
                 that.startPointName +
                 "<br/>" +
@@ -497,7 +491,7 @@ export default {
         })
         .then(res => {
           if (res.data.data == "-1") {
-            this.$message.error("自提车辆无权查看!");
+            this.$message.error("运输订单未关闭,自提车辆无权查看!");
           } else if (res.data.data.startAndEndRoutes != "") {
             that.listPath = res.data.data.startAndEndRoutes;
             that.initMap([105.602725, 37.076636]);
@@ -585,7 +579,7 @@ export default {
           "</font></div></div>"
       ];
       // 创建 infoWindow 实例
-      infoWindow = new AMap.InfoWindow({
+      var infoWindow = new AMap.InfoWindow({
         content: content.join("<br>") //传入 dom 对象,或者 html 字符串
       });
       // 打开信息窗体
@@ -769,24 +763,6 @@ export default {
         console.log(that.geocoder);
       });
     },
-    // 关闭信息窗口
-    closeinfo() {
-      infoWindow.close();
-    },
-    openInfo() {
-      let lon = null;
-      let lat = null;
-      this.listPath.forEach(e => {
-        if (e.endPoint != {} && e.endPoint != "" && e.endPoint != null) {
-          lon = e.endPoint.lon;
-          lat = e.endPoint.lat;
-        } else {
-          lon = e.runRoute[e.runRoute.length - 1].lon;
-          lat = e.runRoute[e.runRoute.length - 1].lat;
-        }
-      });
-      infoWindow.open(this.map, [lon, lat]);
-    },
     //时间格式转换
     formatDate(date, fmt) {
       if (/(y+)/.test(fmt)) {
@@ -822,6 +798,7 @@ export default {
   width: 200px;
   left: 50px;
 }
+
 .controller {
   width: 100%;
   height: 70px;
@@ -929,11 +906,3 @@ span.item_details2 {
   float: left;
 }
 </style>
-<style lang="scss" scoped>
-.btnx {
-  z-index: 1000;
-  position: fixed;
-  bottom: 10px;
-  right: 10px;
-}
-</style>

+ 64 - 39
src/views/sale/components/offSiteTransportation/currentLocation.vue

@@ -1,13 +1,6 @@
 <template>
   <div class="container">
-    <div class="btnx">
-      <el-button type="primary" class="" @click="openInfo"
-        >打开信息窗体</el-button
-      >
-      <el-button type="primary" class="" @click="closeinfo"
-        >关闭信息窗口</el-button
-      >
-    </div>
+    <div id="amap-container"></div>
     <div class="controller">
       <div class="in_transit_information">
         <span class="item_details">车牌号:</span>
@@ -17,12 +10,17 @@
           v-model.trim="carNumber"
         >
         </el-input>
-        <el-button type="primary" class="searchstyle" @click="initData"
+        <el-button
+          type="primary"
+          class="searchstyle"
+          @click="
+            initData();
+            initTimer();
+          "
           >查询</el-button
         >
       </div>
     </div>
-    <div id="amap-container"></div>
   </div>
 </template>
 <script>
@@ -32,15 +30,8 @@ import { sjTime, stringToDate } from "@/utils/sharedJsFile";
 import Slider from "./slider.vue";
 Vue.use(Slider);
 import Vue from "vue";
-var infoWindow;
 export default {
   name: "PathView",
-  data() {
-    return {
-      lon: null,
-      lat: null
-    };
-  },
   setup() {
     const map = shallowRef(null);
     return {
@@ -63,7 +54,11 @@ export default {
       //查询车牌号
       carNumber: "",
       //地图组件
-      map: null
+      map: null,
+      path: [],
+      pointmarker: null,
+      //定时器
+      timer: null
     };
   },
   created() {
@@ -75,18 +70,21 @@ export default {
     //初始化数据
     initData() {
       let that = this;
+      let regExp = /(^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$)/;
       if (that.carNumber == "") {
         this.$message.error("车牌号不能为空!");
         return;
+      } else if (!regExp.test(that.carNumber)) {
+        this.$message.error("请输入正确的车牌号!");
+        return;
       }
       that.axios
         .get("/api/v1/otms/getCurrentLocation?capcityNumber=" + that.carNumber)
         .then(res => {
           console.log(res.data.data);
           if (res.data.data == "-1") {
-            this.$message.error("自提车辆无权查看!");
+            this.$message.error("运输订单未关闭,自提车辆无权查看!");
           } else if (res.data.data.status != "1006") {
-            console.log("res.data.data.status");
             that.map.setCenter([
               res.data.data.result.lon,
               res.data.data.result.lat
@@ -100,6 +98,20 @@ export default {
               res.data.data.result.lat,
               "现在所在位置"
             );
+            //给路径加点
+            let point = new AMap.LngLat(
+              res.data.data.result.lon,
+              res.data.data.result.lat
+            );
+            if (
+              that.path.length <= 0 ||
+              !that.path[that.path.length - 1].equals(point)
+            ) {
+              that.path.push(point);
+            }
+            console.log(that.path);
+            //初始化轨迹
+            that.initPolyline();
             //显示窗体
             that.initCustomMarkes(
               that.carNumber,
@@ -107,8 +119,6 @@ export default {
               res.data.data.result.lon,
               res.data.data.result.lat
             );
-            this.lon = res.data.data.result.lon;
-            this.lat = res.data.data.result.lat;
           } else {
             this.$message.error("车辆暂时无GPS");
           }
@@ -145,6 +155,7 @@ export default {
         title: title
       });
       // 将创建的点标记添加到已有的地图实例:
+      that.pointmarker = pointmarker;
       that.map.add(pointmarker);
     },
 
@@ -161,22 +172,44 @@ export default {
           "</font></div></div>"
       ];
       // 创建 infoWindow 实例
-      infoWindow = new AMap.InfoWindow({
+      var infoWindow = new AMap.InfoWindow({
         content: content.join("<br>"), //传入 dom 对象,或者 html 字符串
         offset: new AMap.Pixel(0, -20) //修改信息差窗体偏移
       });
       // 打开信息窗体
       infoWindow.open(that.map, [lon, lat]);
-      infoWindow.close();
     },
-    // 关闭信息窗口
-    closeinfo() {
-      infoWindow.close();
+
+    //初始化轨迹
+    initPolyline() {
+      let that = this;
+      // 创建一个 Polyline 实例:
+      var polyline = new AMap.Polyline({
+        path: that.path,
+        borderWeight: 2, // 线条宽度,默认为 1
+        strokeColor: "#18BFA6", // 线条颜色
+        lineJoin: "round" // 折线拐点连接处样式
+        // arrowIconPath: require("@/assets/img/traffic_texture_darkred-pass.png")//箭头图片,似乎不支持
+      });
+      // 将创建的线路添加到已有的线路中去:
+      that.map.add(polyline);
     },
-    openInfo() {
-      console.log(this.lon);
-      console.log(this.lat);
-      infoWindow.open(this.map, [this.lon, this.lat]);
+
+    //定时取得当前位置并加入轨迹中去,点击查询时触发,同时清除path和旧的定时器
+    initTimer() {
+      let that = this;
+      //清除旧的定时器
+      clearTimeout(this.timer);
+      //清除path
+      that.path = [];
+      //清除所有覆盖物
+      that.map.clearMap();
+      //设置定时器
+      that.timer = setInterval(() => {
+        //清除之前车的图标
+        that.map.remove(that.pointmarker);
+        that.initData();
+      }, 4000);
     }
   }
 };
@@ -286,11 +319,3 @@ span.item_details2 {
   float: left;
 }
 </style>
-<style lang="scss" scoped>
-.btnx {
-  z-index: 1000;
-  position: fixed;
-  bottom: 10px;
-  right: 10px;
-}
-</style>

+ 1 - 0
src/views/sale/components/offSiteTransportation/transportationPerformance.vue

@@ -278,6 +278,7 @@ export default {
 
     //other
     click(row) {
+     
         this.pathOption.orderNumber=row.orderNumber;
         this.pathOption.capacityNumber=row.capacityNumber;
         this.pathOption.startPointName="达钢集团"+row.outGatepostName,