Browse Source

解决冲突

liyg 3 years ago
parent
commit
e2845dd685

+ 1 - 0
package.json

@@ -44,6 +44,7 @@
     "sass-loader": "^6.0.7",
     "sass-node": "^4.11.2",
     "sass-resources-loader": "^2.2.4",
+    "screenfull": "^5.1.0",
     "script-loader": "^0.7.2",
     "socket.io": "^2.2.0",
     "socket.io-stream": "^0.9.1",

BIN
src/assets/img/TEST01.png


+ 50 - 32
src/components/exportPdf/exportPdf.js

@@ -1,43 +1,61 @@
 // 导出页面为PDF格式
-import html2Canvas from 'html2canvas'
-import JsPDF from 'jspdf'
-export default{
-  install (Vue, options) {
-    Vue.prototype.getPdf = function () {
-      var title = this.htmlTitle
-      html2Canvas(document.querySelector('#pdfDom'), {
+import html2Canvas from "html2canvas";
+import JsPDF from "jspdf";
+export default {
+  install(Vue, options) {
+    Vue.prototype.getPdf = function() {
+      var title = this.htmlTitle;
+      html2Canvas(document.querySelector("#pdfDom"), {
         allowTaint: true
-      }).then(function (canvas) {
-        var pdf = new JsPDF('p', 'mm', 'a4') // A4纸,纵向
+      }).then(function(canvas) {
+        var pdf = new JsPDF("p", "mm", "a4"); // A4纸,纵向
 
-        var ctx = canvas.getContext('2d')
+        var ctx = canvas.getContext("2d");
 
         var a4w = 210;
-        var a4h = 297 // A4大小,210mm x 297mm,四边不保留边距,显示区域210x297 (四边各保留20mm的边距,显示区域170x257)(pass)
+        var a4h = 297; // A4大小,210mm x 297mm,四边不保留边距,显示区域210x297 (四边各保留20mm的边距,显示区域170x257)(pass)
 
-        var imgHeight = Math.floor(a4h * canvas.width / a4w) // 按A4显示比例换算一页图像的像素高度
+        var imgHeight = Math.floor((a4h * canvas.width) / a4w); // 按A4显示比例换算一页图像的像素高度
 
-        var renderedHeight = 0
+        var renderedHeight = 0;
 
         while (renderedHeight < canvas.height) {
-            var page = document.createElement('canvas')
-
-            page.width = canvas.width
-
-            page.height = Math.min(imgHeight, canvas.height - renderedHeight) // 可能内容不足一页
-
-            // 用getImageData剪裁指定区域,并画到前面建立的canvas对象中
-            page.getContext('2d').putImageData(ctx.getImageData(0, renderedHeight, canvas.width, Math.min(imgHeight, canvas.height - renderedHeight)), 0, 0)
-            pdf.addImage(page.toDataURL('image/jpeg', 1.0), 'JPEG', 0, 0, a4w, Math.min(a4h, a4w * page.height / page.width)) // 添加图像到页面,保留10mm边距
-            renderedHeight += imgHeight
-
-            if (renderedHeight < canvas.height) {
-                pdf.addPage()
-            } // 若是后面还有内容,添加一个空页
-            // delete page;
+          var page = document.createElement("canvas");
+
+          page.width = canvas.width;
+
+          page.height = Math.min(imgHeight, canvas.height - renderedHeight); // 可能内容不足一页
+
+          // 用getImageData剪裁指定区域,并画到前面建立的canvas对象中
+          page
+            .getContext("2d")
+            .putImageData(
+              ctx.getImageData(
+                0,
+                renderedHeight,
+                canvas.width,
+                Math.min(imgHeight, canvas.height - renderedHeight)
+              ),
+              0,
+              0
+            );
+          pdf.addImage(
+            page.toDataURL("image/jpeg", 1.0),
+            "JPEG",
+            0,
+            0,
+            a4w,
+            Math.min(a4h, (a4w * page.height) / page.width)
+          ); // 添加图像到页面,保留10mm边距
+          renderedHeight += imgHeight;
+
+          if (renderedHeight < canvas.height) {
+            pdf.addPage();
+          } // 若是后面还有内容,添加一个空页
+          // delete page;
         }
-        pdf.save(title + '.pdf')
-    })
-    }
+        pdf.save(title + ".pdf");
+      });
+    };
   }
-}
+};

+ 63 - 0
src/components/exportPdfs/exportPdfs.js

@@ -0,0 +1,63 @@
+// 导出页面为PDF格式
+import html2Canvas from "html2canvas";
+import JsPDF from "jspdf";
+export default {
+  install(Vue, options) {
+    Vue.prototype.getPdfs = function() {
+      var title = this.htmlTitle;
+      console.log(document.querySelector("#pdfDom"));
+      html2Canvas(document.querySelector("#pdfDom"), {
+        allowTaint: false,
+        // useCORS: true,
+        windowWidth: 1695,
+        width: 1695
+      }).then(function(canvas) {
+        var pdf = new JsPDF("l", "mm", "a4"); // A4纸,横向
+        var ctx = canvas.getContext("2d");
+        var a4w = 300;
+        var a4h = 297; // A4大小,210mm x 297mm,四边不保留边距,显示区域210x297 (四边各保留20mm的边距,显示区域170x257)(pass)
+
+        var imgHeight = Math.floor((a4h * canvas.width) / a4w); // 按A4显示比例换算一页图像的像素高度
+
+        var renderedHeight = 0;
+
+        while (renderedHeight < canvas.height) {
+          var page = document.createElement("canvas");
+
+          page.width = canvas.width;
+
+          page.height = Math.min(imgHeight, canvas.height - renderedHeight); // 可能内容不足一页
+
+          // 用getImageData剪裁指定区域,并画到前面建立的canvas对象中
+          page
+            .getContext("2d")
+            .putImageData(
+              ctx.getImageData(
+                0,
+                renderedHeight,
+                canvas.width,
+                Math.min(imgHeight, canvas.height - renderedHeight)
+              ),
+              0,
+              0
+            );
+          pdf.addImage(
+            page.toDataURL("image/jpeg", 1.0),
+            "JPEG",
+            0,
+            0,
+            a4w,
+            Math.min(a4h, (a4w * page.height) / page.width)
+          ); // 添加图像到页面,保留10mm边距
+          renderedHeight += imgHeight;
+
+          if (renderedHeight < canvas.height) {
+            pdf.addPage();
+          } // 若是后面还有内容,添加一个空页
+          // delete page;
+        }
+        pdf.save(title + ".pdf");
+      });
+    };
+  }
+};

+ 4 - 4
src/views/ADMINISTRATORS/components/ADMINISTRATORS1.vue

@@ -197,7 +197,10 @@ export default {
       lineQuence: null
     };
   },
-  created() {},
+  created() {
+    this.value1 = new Date();
+    this.value2 = new Date();
+  },
   mounted() {
     this.information();
   },
@@ -256,9 +259,6 @@ export default {
                   this.materialList = res.data.data;
                 }
               });
-            this.axios
-              .get("/api/v1/uc/getPurOrgId?orderId=" + this.orderId)
-              .then(res => {});
           }
         });
     },

+ 229 - 216
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="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>
-            <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 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>
-        <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="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 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 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,204 +109,217 @@ 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.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.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"
+        };
       }
-       //先新增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;

+ 5 - 1
src/views/TMS/components/importedIngredients/transportReserveFuAddIngredients.vue

@@ -422,7 +422,8 @@ export default {
     getPurchaseOrderNo() {
       let map = {
         materialId: this.materialId,
-        supplierId: this.supplierId
+        supplierId: this.supplierId,
+        purchaseOrgId: 1
       };
       if (this.remark) {
         map.remark = this.remark;
@@ -495,6 +496,7 @@ export default {
             this.supplierId +
             "&con=" +
             this.input +
+            "&purchaseOrgId=1" +
             "&i=" +
             new Date();
         }
@@ -536,6 +538,7 @@ export default {
           this.purchaseOrder.requestUrl =
             "/api/v1/ams/getPurchaseOrderList?apiId=81&sendCompId=" +
             this.supplierId +
+            "&purchaseOrgId=1" +
             "&i=" +
             new Date();
         }
@@ -592,6 +595,7 @@ export default {
         this.purchaseOrder.requestUrl =
           "/api/v1/ams/getPurchaseOrderList?apiId=81&sendCompId=" +
           this.supplierId +
+          "&purchaseOrgId=1" +
           "&i=" +
           new Date();
       }

+ 7 - 6
src/views/WMS/components/port_deposit/port_deposit_outbound.vue

@@ -24,10 +24,11 @@ export default {
       activeName: "first",
       option1: {
         // 表格请求数据的地址
-        requestUrl: "/api/v1/wmsh/getOutBoundResult?apiId=159",
-      },
+        requestUrl: "/api/v1/wmsh/getOutBoundResult?apiId=159"
+      }
     };
   },
+  filters: {},
   methods: {
     onclick() {
       if (this.activeName == "first") {
@@ -37,11 +38,11 @@ export default {
     },
     handleClick(tab, event) {
       console.log(tab, event);
-    },
-  },
+    }
+  }
 };
 </script>
-<style lang='scss' scoped>
+<style lang="scss" scoped>
 .homeworkPath {
   .top {
     padding: 1.25rem 0.375rem;
@@ -55,4 +56,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 59 - 35
src/views/appoint/app.js

@@ -1,61 +1,85 @@
 // The Vue build version to load with the `import` command
 // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
-import Vue from 'vue';
-import App from '@/components/App.vue';
+import Vue from "vue";
+import App from "@/components/App.vue";
 // include
-import '@/config/include.js';
+import "@/config/include.js";
 
 // 通用store
-import store from '@/store/index.js';
+import store from "@/store/index.js";
 
 // router
-import router from './router/index.js';
+import router from "./router/index.js";
 
-import VueApollo from 'vue-apollo'
+import VueApollo from "vue-apollo";
 
-import apollo from '@/config/apolloConfig.js'
+import apollo from "@/config/apolloConfig.js";
 
 // 关闭生产模式下给出的提示
 Vue.config.productionTip = false;
 
-Vue.use(VueApollo)
-import 'xe-utils' 
-import VXETable from 'vxe-table'
-import 'vxe-table/lib/style.css'
-Vue.use(VXETable)
-Vue.prototype.$XModal = VXETable.modal
+Vue.use(VueApollo);
+import "xe-utils";
+import VXETable from "vxe-table";
+import "vxe-table/lib/style.css";
+Vue.use(VXETable);
+Vue.prototype.$XModal = VXETable.modal;
 
 // 注册表格的全局组件
 import DilCommonUI from "@/components/DilCommonUI";
 Vue.use(DilCommonUI);
 
-import htmlToPdf from '@/components/exportPdf/exportPdf'
-Vue.use(htmlToPdf)
+import htmlToPdf from "@/components/exportPdf/exportPdf";
+Vue.use(htmlToPdf);
 
-import vuescroll from "vuescroll";//引入vuescroll
-import "vuescroll/dist/vuescroll.css";//引入vuescroll样式
-Vue.use(vuescroll);//使用
+import vuescroll from "vuescroll"; //引入vuescroll
+import "vuescroll/dist/vuescroll.css"; //引入vuescroll样式
+Vue.use(vuescroll); //使用
 
 // 导出Excel全局组件
-import tableToExcel from '@/components/exportExcel/exportExcel'
-Vue.use(tableToExcel)
+import tableToExcel from "@/components/exportExcel/exportExcel";
+Vue.use(tableToExcel);
 
 const apolloProvider = new VueApollo({
-    defaultClient: apollo
-})
+  defaultClient: apollo
+});
 
- //把时间戳改为正常可读的时间
- export function renderTime(date) {
-  if(date !== null){
-      let dateee = new Date(date).toJSON();
-      return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, " ").replace(/\.[\d]{3}Z/, "");
+//禁止打开控制台
+document.onkeydown = () => {
+  //禁用F12
+  if (window.event && window.event.keyCode == 123) {
+    return false;
+    //禁用ctrl+shift+i,
+  } else if (
+    window.event.ctrlKey &&
+    window.event.shiftKey &&
+    window.event.keyCode == 73
+  ) {
+    return false;
+    //屏蔽Shift+F10
+  } else if (window.event.shiftKey && window.event.keyCode == 121) {
+    return false;
+  }
+};
+
+// console.log = function() {};
+// console.error = function() {};
+
+//把时间戳改为正常可读的时间
+export function renderTime(date) {
+  if (date !== null) {
+    let dateee = new Date(date).toJSON();
+    return new Date(+new Date(dateee) + 8 * 3600 * 1000)
+      .toISOString()
+      .replace(/T/g, " ")
+      .replace(/\.[\d]{3}Z/, "");
   }
   return null;
 }
 //把毫秒数转换分
-export function getDuration(my_time) { 
-  if(my_time !== null){
-      return Math.floor(my_time / 1000 / 60);
+export function getDuration(my_time) {
+  if (my_time !== null) {
+    return Math.floor(my_time / 1000 / 60);
   }
   return null;
 }
@@ -66,11 +90,11 @@ export function sjTime(orderPlanInTime) {
 }
 //验证电话号码
 export function VerifyPhoneNumber(Phone) {
-  var myreg=/^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;
+  var myreg = /^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;
   if (!myreg.test(Phone)) {
-      return false;
+    return false;
   } else {
-      return true;
+    return true;
   }
 }
 export function isNumber(value) {
@@ -93,10 +117,10 @@ export function isIntegerNumber(value) {
 }
 /* eslint-disable no-new */
 new Vue({
-  el: '#app',
+  el: "#app",
   router,
   store,
   components: { App },
   provide: apolloProvider.provide(),
-  template: '<App/>'
+  template: "<App/>"
 });

+ 56 - 1
src/views/appoint/components/saleContract/saleOrderSteel.vue

@@ -2,7 +2,29 @@
   <!-- 销售订单页面 -->
   <div class="salePlan">
     <div class="top">
-      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
+      <span>订单时间:</span>
+      <el-date-picker
+        v-model="startTime"
+        type="datetime"
+        placeholder="选择日期"
+        style="width:220px"
+      >
+      </el-date-picker>
+      <span>至</span>
+      <el-date-picker
+        v-model="endTime"
+        type="datetime"
+        placeholder="选择日期"
+        style="width:220px"
+      >
+      </el-date-picker>
+      <el-input
+        placeholder="请输入内容"
+        v-model="input"
+        clearable
+        style="width:250px"
+      >
+      </el-input>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
@@ -116,10 +138,13 @@
 </template>
 <script>
 import { getCookie } from "@/utils/util.js";
+import { sjTime } from "@/utils/sharedJsFile";
 export default {
   name: "saleOrder",
   data() {
     return {
+      startTime: null,
+      endTime: null,
       batchReportList: [],
       activeName: "first",
       tableTitle: "未上传销售订单报表",
@@ -337,6 +362,12 @@ export default {
       console.log(tab, event);
     },
     onclick() {
+      var startTime = null;
+      var endTime = null;
+      if (this.startTime && this.endTime) {
+        startTime = sjTime(this.startTime);
+        endTime = sjTime(this.endTime);
+      }
       if (getCookie("orgCode") == "shouhuokehu") {
         if (this.activeName == "first") {
           this.option.requestUrl =
@@ -344,6 +375,10 @@ export default {
             this.input +
             "&consigneeSsoId=" +
             getCookie("userId") +
+            "&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
             "&i=" +
             new Date();
         } else if (this.activeName == "second") {
@@ -352,6 +387,10 @@ export default {
             this.input +
             "&consigneeSsoId=" +
             getCookie("userId") +
+            "&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
             "&i=" +
             new Date();
         } else if (this.activeName == "four") {
@@ -360,6 +399,10 @@ export default {
             this.input +
             "&consigneeSsoId=" +
             getCookie("userId") +
+            "&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
             "&i=" +
             new Date();
         }
@@ -368,18 +411,30 @@ export default {
           this.option.requestUrl =
             "/api/v1/ams/getSaleOrderInfoes?apiId=408&saleType=1&con=" +
             this.input +
+            "&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
             "&i=" +
             new Date();
         } else if (this.activeName == "second") {
           this.option2.requestUrl =
             "/api/v1/ams/getSaleOrderReportedes?apiId=408&saleType=1&con=" +
             this.input +
+            "&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
             "&i=" +
             new Date();
         } else if (this.activeName == "four") {
           this.option4.requestUrl =
             "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409&saleType=1&shipperId=1&con=" +
             this.input +
+            "&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
             "&i=" +
             new Date();
         }

+ 7 - 1
src/views/appoint/components/saleContract/updateSaleOrderSteel.vue

@@ -208,6 +208,7 @@
                     <el-button
                       type="primary"
                       @click="changeMaterial(scope.$index)"
+                      v-if="scope.row.netWeight == null"
                       >更改</el-button
                     >
                   </template>
@@ -217,13 +218,16 @@
                       class="textinput111"
                       v-model.number="scope.row.orderPlanWeight"
                       placeholder="(必填)"
+                      :disabled="scope.row.netWeight != null"
                     ></el-input>
                   </template>
                   <!-- 米数 -->
                   <template v-if="item.prop == 'meterNumber'">
                     <el-input
                       v-if="scope.row.haveMeter == 1"
-                      :disabled="scope.row.isDisable == 1"
+                      :disabled="
+                        scope.row.isDisable == 1 || scope.row.netWeight != null
+                      "
                       class="textinput111"
                       v-model.number="scope.row.meterNumber"
                       placeholder="(必填)"
@@ -235,6 +239,7 @@
                       v-model="scope.row.isPound"
                       placeholder="请选择"
                       style="width:65px"
+                      :disabled="scope.row.netWeight != null"
                     >
                       <el-option
                         v-for="item in options2"
@@ -261,6 +266,7 @@
                   type="text"
                   icon="el-icon-close"
                   size="big"
+                  v-if="scope.row.netWeight == null"
                 ></el-button>
               </template>
             </el-table-column>

+ 36 - 2
src/views/sale/components/offSiteTransportation/checkGPS.vue

@@ -2,6 +2,14 @@
   <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
@@ -147,6 +155,7 @@ 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() {
@@ -579,7 +588,7 @@ export default {
           "</font></div></div>"
       ];
       // 创建 infoWindow 实例
-      var infoWindow = new AMap.InfoWindow({
+      infoWindow = new AMap.InfoWindow({
         content: content.join("<br>") //传入 dom 对象,或者 html 字符串
       });
       // 打开信息窗体
@@ -763,6 +772,24 @@ 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)) {
@@ -798,7 +825,6 @@ export default {
   width: 200px;
   left: 50px;
 }
-
 .controller {
   width: 100%;
   height: 70px;
@@ -906,3 +932,11 @@ span.item_details2 {
   float: left;
 }
 </style>
+<style lang="scss" scoped>
+.btnx {
+  z-index: 1000;
+  position: fixed;
+  bottom: 10px;
+  right: 10px;
+}
+</style>

+ 59 - 49
src/views/sale/components/offSiteTransportation/currentLocation.vue

@@ -1,13 +1,20 @@
 <template>
   <div class="container">
-    <div id="amap-container"></div>
+    <div class="btnx">
+      <el-button type="primary" class="" @click="openInfo"
+        >打开信息窗体</el-button
+      >
+      <el-button type="primary" class="" @click="closeinfo"
+        >关闭信息窗口</el-button
+      >
+    </div>
     <div class="controller">
       <div class="in_transit_information">
         <span class="item_details">车牌号:</span>
-        <el-input style="width: 120px;" class="inputStyle" v-model.trim="carNumber"> </el-input>
-        <el-button type="primary" class="searchstyle" @click="initData();initTimer()">查询</el-button>
+        <el-button type="primary" class="searchstyle" @click="initData">查询</el-button>
       </div>
     </div>
+    <div id="amap-container"></div>
   </div>
 </template>
 <script>
@@ -17,8 +24,15 @@ 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 {
@@ -38,27 +52,20 @@ export default {
   },
   data() {
     return {
-     
       //查询车牌号
       carNumber: "",
       //地图组件
-      map:null,
-      path:[],
+ 	  path:[],
       pointmarker:null,
       //定时器
       timer: null,
-    };
+};
   },
   created() {
-    let that =this;
     that.initMap(105.602725,37.076636)
   },
-  mounted() {
-    
-  },
+  mounted() {},
   methods: {
-    
-
     //初始化数据
     initData() {
       let that = this;
@@ -72,46 +79,34 @@ export default {
       }
       that.axios
         .get("/api/v1/otms/getCurrentLocation?capcityNumber="+that.carNumber)
-        .then(res => {
-              console.log(res.data.data)
-              if(res.data.data=='-1'){
+		.then(res => {
                  this.$message.error('运输订单未关闭,自提车辆无权查看!');
-              }else if(res.data.data.status!='1006'){
-                that.map.setCenter([res.data.data.result.lon,res.data.data.result.lat]);
-                //画车
-                that.initMarkes( 45,60, require("@/assets/img/car1.png"),res.data.data.result.lon,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,res.data.data.result.adr,res.data.data.result.lon,res.data.data.result.lat);
-              }else{
-                  this.$message.error("车辆暂时无GPS");
-              }
+                  that.initMarkes( 45,60, require("@/assets/img/car1.png"),res.data.data.result.lon,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();
           });
-          
-    },
-   
-   
+},
+
     //初始化地图
-    initMap(lon,lat) {
+    initMap(lon, lat) {
       lazyAMapApiLoaderInstance.load().then(() => {
         let that = this;
         that.map = new AMap.Map("amap-container", {
           //设置地图容器id
           viewMode: "2D", //是否为2D地图模式
           zoom: 18, //初始化地图级别
-          center: [lon,lat] //初始化地图中心点位置105.602725,37.076636
+          center: [lon, lat] //初始化地图中心点位置105.602725,37.076636
         });
       });
     },
 
-     //创建简单的标记
+    //创建简单的标记
     initMarkes(weight, height, image, lon, lat, title) {
       let that = this;
       //图标标记点
@@ -131,7 +126,7 @@ export default {
       that.pointmarker=pointmarker;
       that.map.add(pointmarker);
     },
-   
+
     //初始化窗体
     initCustomMarkes(title, details, lon, lat) {
       let that = this;
@@ -145,15 +140,24 @@ export default {
           "</font></div></div>"
       ];
       // 创建 infoWindow 实例
-      var infoWindow = new AMap.InfoWindow({
-        content: content.join("<br>"),//传入 dom 对象,或者 html 字符串
-        offset:new AMap.Pixel(0,-20)//修改信息差窗体偏移
+      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();
+    },
+    openInfo() {
+      console.log(this.lon);
+      console.log(this.lat);
+      infoWindow.open(this.map, [this.lon, this.lat]);
+    }	,
+//初始化轨迹
     initPolyline() {
       let that = this;
       // 创建一个 Polyline 实例:
@@ -183,9 +187,7 @@ export default {
         that.map.remove(that.pointmarker);
         that.initData();
       },4000);
-    }
-  
-  }
+    }}
 };
 </script>
 <style>
@@ -293,3 +295,11 @@ span.item_details2 {
   float: left;
 }
 </style>
+<style lang="scss" scoped>
+.btnx {
+  z-index: 1000;
+  position: fixed;
+  bottom: 10px;
+  right: 10px;
+}
+</style>

+ 788 - 684
src/views/sale/components/offSiteTransportation/mapTest.vue

@@ -1,735 +1,839 @@
 <template>
-    <div class="container">
-        <div id="amap-container"></div>
-         <div class="mapcontroller">
-             <div class="in_transit_information">
-                 <label class="item_details">起点:{{startPointName}}</label>
-                 <br/>
-                 <label class="item_details">收货地址:{{endPointName}}</label>
-                 <br/>
-             </div>
-             <div class="driving_information2">  
-                <label class="item_details">时间:{{runRoute.gtm}}</label>
-                <br/>
-                <label class="item_details">车速:{{runRoute.spd}}千米/小时</label>
-                <br/>
-                <br/> 
-                <!--控制条-->
-                <div class="map-control" v-show="isActual">
-                    <!--播放暂停按钮-->
-                    <Icon v-if="!isPlay" class="play-icon play"  type="ios-play" @click="isPlay=true;play();navgControl(playIcon)"/>
-                    <Icon v-else class="play-icon pause" type="ios-pause" @click="isPlay=false;stop();navgControl('pause')"/>
-                    <Icon class="play-icon quickly"  type="ios-play" @click="addIndex()"/>
-                    <!--已播放时间-->
-                    <!--进度条-->
-                    <div class="mySlider"><Slider class="map-slider" v-model="sliderVal" :tip-format="hideFormat" :step="0.0001"></Slider></div>
-                </div>
-             </div>
-         </div>
-        <el-row>
-                <el-button type="primary" @click="slow">慢速</el-button>
-                <el-button type="success" @click="middle">中速</el-button>
-                <el-button type="danger" @click="fast">快速</el-button>
-                <el-button type="success" @click="addIndex" plain>快进</el-button> 
-                <el-button type="danger" @click="stop" plain>暂停</el-button>
-                <el-button type="success" @click="play" plain>开始</el-button>
-                <el-select style="width:100px" @change="changeParkingTime"  v-model="parkingTime"  placeholder="停车" >
-                    <el-option  v-for="item in parkingOptions" :key="item.value" :label="item.label" :value="item.value" >
-                    </el-option>
-                </el-select>
-                <el-select  style="width:100px" @change="changeLeaveTime"  v-model="leaveTime" placeholder="离线" >
-                    <el-option v-for="item in parkingOptions" :key="item.value" :label="item.label" :value="item.value" >
-                    </el-option>
-                </el-select>
-     </el-row>
-
+  <div class="container">
+    <div id="amap-container"></div>
+    <div class="mapcontroller">
+      <div class="in_transit_information">
+        <label class="item_details">起点:{{ startPointName }}</label>
+        <br />
+        <label class="item_details">收货地址:{{ endPointName }}</label>
+        <br />
+      </div>
+      <div class="driving_information2">
+        <label class="item_details">时间:{{ runRoute.gtm }}</label>
+        <br />
+        <label class="item_details">车速:{{ runRoute.spd }}千米/小时</label>
+        <br />
+        <br />
+        <!--控制条-->
+        <div class="map-control" v-show="isActual">
+          <!--播放暂停按钮-->
+          <Icon
+            v-if="!isPlay"
+            class="play-icon play"
+            type="ios-play"
+            @click="
+              isPlay = true;
+              play();
+              navgControl(playIcon);
+            "
+          />
+          <Icon
+            v-else
+            class="play-icon pause"
+            type="ios-pause"
+            @click="
+              isPlay = false;
+              stop();
+              navgControl('pause');
+            "
+          />
+          <Icon class="play-icon quickly" type="ios-play" @click="addIndex()" />
+          <!--已播放时间-->
+          <!--进度条-->
+          <div class="mySlider">
+            <Slider
+              class="map-slider"
+              v-model="sliderVal"
+              :tip-format="hideFormat"
+              :step="0.0001"
+            ></Slider>
+          </div>
+        </div>
+      </div>
+    </div>
+    <el-row>
+      <el-button type="primary" @click="slow">慢速</el-button>
+      <el-button type="success" @click="middle">中速</el-button>
+      <el-button type="danger" @click="fast">快速</el-button>
+      <el-button type="success" @click="addIndex" plain>快进</el-button>
+      <el-button type="danger" @click="stop" plain>暂停</el-button>
+      <el-button type="success" @click="play" plain>开始</el-button>
+      <el-select
+        style="width:100px"
+        @change="changeParkingTime"
+        v-model="parkingTime"
+        placeholder="停车"
+      >
+        <el-option
+          v-for="item in parkingOptions"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        style="width:100px"
+        @change="changeLeaveTime"
+        v-model="leaveTime"
+        placeholder="离线"
+      >
+        <el-option
+          v-for="item in parkingOptions"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option>
+      </el-select>
+    </el-row>
+    <div class="btnx">
+      <el-button type="primary" class="" @click="openInfo"
+        >打开信息窗体</el-button
+      >
+      <el-button type="primary" class="" @click="closeinfo"
+        >关闭信息窗口</el-button
+      >
     </div>
+  </div>
 </template>
 
 <script>
-import AMapLoader from '@amap/amap-jsapi-loader';
-import { shallowRef } from '@vue/reactivity'
-import { Loading } from 'element-ui';
-import { lazyAMapApiLoaderInstance } from 'vue-amap';
-import Slider from './slider.vue'
-Vue.use(Slider)
+import AMapLoader from "@amap/amap-jsapi-loader";
+import { shallowRef } from "@vue/reactivity";
+import { Loading } from "element-ui";
+import { lazyAMapApiLoaderInstance } from "vue-amap";
+import Slider from "./slider.vue";
+Vue.use(Slider);
 import AMapJS from "amap-js";
-import Vue from 'vue';
+import Vue from "vue";
+var infoWindow;
 export default {
-    name: "PathView",
-    props:{
-        orderNumber:'',
-        capacityNumber:'',
-        startPointName:'',
-        endPointName:'',
-        startTime:'',
-        endTime:'',
-    },
-    setup(){
-        const map = shallowRef(null);
-        return{
-            map,
-        }
-    },
-     watch:{
-        //监听车牌号变化
-        orderNumber:{
-            deep: true,
-            handler(val, oldVal) {
-                console.log(val)
-                this.initData(val);
-            }
-        }
-    },
-    data() {
-        return {
-            ///che
-            isTimesChoose:false,
-            isActual:true,
-            isPlay:false,
-            passedTime:"12:02:10",
-            sliderVal:0,
-            times:1,
-            totalTime:"11",
-            speed:10000,
-             //选择停车时长
-            parkingTime: null,
-            //停车时长选择区间
-            parkingOptions: [
-                {
-                value: 600000,
-                label: "10分钟"
-                },
-                {
-                value: 1200000,
-                label: "20分钟"
-                },
-                {
-                value: 1800000,
-                label: "30分钟"
-                },
-                {
-                value: 2400000,
-                label: "40分钟"
-                },
-                {
-                value: 3000000,
-                label: "50分钟"
-                },
-                {
-                value: 3600000,
-                label: "60分钟"
-                },
-                {
-                value: 36000000,
-                label: "关闭"
-                }
-            ],
-            //离线图标
-            leaveMark: [],
-            //停车图标
-            parkMark: [],
-            //选择离线时长
-            leaveTime: null,
-            //离线时长选择区间
-            leaveOptions: [
-                {
-                value: 600000,
-                label: "10分钟"
-                },
-                {
-                value: 1200000,
-                label: "20分钟"
-                },
-                {
-                value: 1800000,
-                label: "30分钟"
-                },
-                {
-                value: 2400000,
-                label: "40分钟"
-                },
-                {
-                value: 3000000,
-                label: "50分钟"
-                },
-                {
-                value: 3600000,
-                label: "60分钟"
-                },
-                {
-                value: 36000000,
-                label: "关闭"
-                }
-            ],
-            //已行驶轨迹
-            runRoute:
-            {
-                agl: "",
-                gtm: "",
-                hgt: "",
-                lat: "",
-                lon: "",
-                mil: "",
-                spd: ""
-            },
-            point:"",
-            pointNext:"",
-            loading : null,
-            navgtrSpeed:1,
-            //地图中心位置
-            centerPoint:{
-                    pointLat:"",
-                    pointLon:""
-            },
-            //自定义窗体信息
-            ctmarkes:{
-                lat:"33.015888071433764",
-                lon : "115.96995235868168",
-                title:"豫SE8888",
-                details:"安徽省阜阳市颍东区阜阳舜岳水泥公司,西北方向,155.1米"
-            },
-            //运输详情
-            transportDetail:{
-                //车牌号
-                capacityNumber:'',
-                //规划路线
-                estimateRoute:[
-                    {
-                        lat:"33.015888071433764",
-                        lon : "115.96995235868168"
-                    }
-                ],
-                //规划线路
-                estimatePath:[
-                    [
-                        114.03046212985384,
-                        32.49786984660489
-                    ],
-                    
-                ],
-                //已行驶轨迹
-                runRoute:[
-                      {
-                        agl: "44",
-                        gtm: "2022年03月09日 16:47:24",
-                        hgt: "13",
-                        lat: "32.906411535084985",
-                        lon: "115.76177868692135",
-                        mil: "429409.2",
-                        spd: "17.0"
-                    },
-                ],
-                runPath: [
-                    [
-                        114.03922119568348,
-                        32.49746162481379
-                    ],
-                ],
-                //当前位置
-                currentPointName:"中国达州市通川区",
-                //当前位置经纬度
-                currentPoint:{
-                    lat:"",
-                    lon:""
-                },
-                //起点位置
-                startPointName:"中国达州市通川区", 
-                //起点位置经纬度
-                startPoint:{
-                    lon:"114.03922119568348",
-                    lat:"32.49746162481379"
-                },
-                //终点位置
-                endPointName:"中国成都萧山",
-                //终点位置经纬度   
-                endPoint:{
-                    lon:"115.96995737755431",
-                    lat:"33.01595479752097"
-                },
-                //自定义标记
-                content:[],
-                //异常位置
-                abnormalLocation:[],
-            
-            },
-            listPath:[
-                
-            ],
-            //组件
-            pathSimplifierIns:{},
-            pathNavigator:{},
-            //地图解析
-            geocoder:null,
-            currentPointName:""
-        };
-    },
-    created(){
-        let that=this;
-         that.initData(that.orderNumber)
-    },
-    mounted() {
-        
-    },
-    methods: {
-        //停车时间改变
-        changeParkingTime() {
-            let that = this;
-            //清除之前的停车点
-            that.hideParkingMark();
-            //计算时间的点
-            let calculationPoint = null;
-            that.listPath[0].runRoute.forEach(function(item, indexOf) {
-                if (indexOf + 1 < that.listPath[0].runRoute.length) {
-                //判断calculationPoint是否为空,如果是空的说明当前没有在计算停车时间
-                if (calculationPoint == null && item.spd == "0.0") {
-                    calculationPoint = item;
-                } else if (calculationPoint != null && item.spd != "0.0") {
-                    let beforeTime = that.stringToDate(calculationPoint.gtm);
-                    let item2 = that.listPath[0].runRoute[indexOf];
-                    let afterTime = that.stringToDate(item2.gtm);
-                    let second = afterTime - beforeTime;
-                    if (second > that.parkingTime) {
-                        let message = "停车:" + second / 60000;
-                        that.initParkingMarkes(
-                            20,
-                            35,
-                            require("@/assets/img/park.png"),
-                            calculationPoint.lon,
-                            calculationPoint.lat,
-                            message.split(".")[0] + "分钟"
-                        );
-                    }
-                    calculationPoint = null;
-                }
-            }
-        });
+  name: "PathView",
+  props: {
+    orderNumber: "",
+    capacityNumber: "",
+    startPointName: "",
+    endPointName: "",
+    startTime: "",
+    endTime: ""
+  },
+  setup() {
+    const map = shallowRef(null);
+    return {
+      map
+    };
+  },
+  watch: {
+    //监听车牌号变化
+    orderNumber: {
+      deep: true,
+      handler(val, oldVal) {
+        console.log(val);
+        this.initData(val);
+      }
+    }
+  },
+  data() {
+    return {
+      ///che
+      isTimesChoose: false,
+      isActual: true,
+      isPlay: false,
+      passedTime: "12:02:10",
+      sliderVal: 0,
+      times: 1,
+      totalTime: "11",
+      speed: 10000,
+      //选择停车时长
+      parkingTime: null,
+      //停车时长选择区间
+      parkingOptions: [
+        {
+          value: 600000,
+          label: "10分钟"
         },
-         //字符串转为Date
-        stringToDate(dateString) {
-            console.log(dateString)
-            let dateStr = dateString.replace("年", "-").replace("月", "-").replace("日", "");
-            return Date.parse(dateStr);
-    
-            
+        {
+          value: 1200000,
+          label: "20分钟"
         },
-        //停车所有离线图标
-        hideParkingMark() {
-        let that = this;
-        
-        that.parkMark.forEach(function(item, indexOf) {
-            item.hide();
-        });
+        {
+          value: 1800000,
+          label: "30分钟"
         },
-        //离线时间改变时获得超过时间的点信息
-        changeLeaveTime() {
-            let that = this;
-            //关闭所有图标
-            that.hideLeaveMark();
-           that.listPath[0].runRoute.forEach(function(item, indexOf) {
-                if (indexOf + 1 < that.listPath[0].runRoute.length) {
-                    let beforeTime = that.stringToDate(item.gtm);
-                    let item2 = that.listPath[0].runRoute[indexOf + 1];
-                    let afterTime = that.stringToDate(item2.gtm);
-                    let second = afterTime - beforeTime;
-                    if (second > that.leaveTime) {
-                        let message = "离线:" + second / 60000;
-                        that.initLeaveMarkes(
-                        20,
-                        35,
-                        require("@/assets/img/leave.png"),
-                        item2.lon,
-                        item2.lat,
-                        message.split(".")[0] + "分钟"
-                        );
-                    }
-                }
-            });
+        {
+          value: 2400000,
+          label: "40分钟"
         },
-        //关闭所有离线图标
-        hideLeaveMark() {
-        let that = this;
-        that.leaveMark.forEach(function(item, indexOf) {
-            item.hide();
-        });
+        {
+          value: 3000000,
+          label: "50分钟"
         },
-        slow(){
-             console.log("slow")
-            let that=this;
-            that.pathNavigator.setSpeed(1000);
+        {
+          value: 3600000,
+          label: "60分钟"
         },
-        middle(){
-             console.log("middle")
-            let that=this;
-           that.pathNavigator.setSpeed(10000);
+        {
+          value: 36000000,
+          label: "关闭"
+        }
+      ],
+      //离线图标
+      leaveMark: [],
+      //停车图标
+      parkMark: [],
+      //选择离线时长
+      leaveTime: null,
+      //离线时长选择区间
+      leaveOptions: [
+        {
+          value: 600000,
+          label: "10分钟"
         },
-        fast(){
-            console.log("fast")
-            let that=this;
-            that.pathNavigator.setSpeed(100000);
+        {
+          value: 1200000,
+          label: "20分钟"
         },
-        play(){
-            let that =this;
-            that.pathNavigator.resume();
+        {
+          value: 1800000,
+          label: "30分钟"
         },
-        stop(){
-            let that =this;
-            that.pathNavigator.pause();
+        {
+          value: 2400000,
+          label: "40分钟"
         },
-        addIndex(){
-
-            let that =this;
-            let increment=(that.listPath[0].runPath.length*0.1)
-            that.pathNavigator.start(((that.point+increment)%that.listPath[0].runPath.length))
+        {
+          value: 3000000,
+          label: "50分钟"
         },
-        ///che
-        navgControl(){
-
+        {
+          value: 3600000,
+          label: "60分钟"
         },
-        hideFormat(value){
-            let that=this;
-            that.sliderVal=value;
+        {
+          value: 36000000,
+          label: "关闭"
+        }
+      ],
+      //已行驶轨迹
+      runRoute: {
+        agl: "",
+        gtm: "",
+        hgt: "",
+        lat: "",
+        lon: "",
+        mil: "",
+        spd: ""
+      },
+      point: "",
+      pointNext: "",
+      loading: null,
+      navgtrSpeed: 1,
+      //地图中心位置
+      centerPoint: {
+        pointLat: "",
+        pointLon: ""
+      },
+      //自定义窗体信息
+      ctmarkes: {
+        lat: "33.015888071433764",
+        lon: "115.96995235868168",
+        title: "豫SE8888",
+        details: "安徽省阜阳市颍东区阜阳舜岳水泥公司,西北方向,155.1米"
+      },
+      //运输详情
+      transportDetail: {
+        //车牌号
+        capacityNumber: "",
+        //规划路线
+        estimateRoute: [
+          {
+            lat: "33.015888071433764",
+            lon: "115.96995235868168"
+          }
+        ],
+        //规划线路
+        estimatePath: [[114.03046212985384, 32.49786984660489]],
+        //已行驶轨迹
+        runRoute: [
+          {
+            agl: "44",
+            gtm: "2022年03月09日 16:47:24",
+            hgt: "13",
+            lat: "32.906411535084985",
+            lon: "115.76177868692135",
+            mil: "429409.2",
+            spd: "17.0"
+          }
+        ],
+        runPath: [[114.03922119568348, 32.49746162481379]],
+        //当前位置
+        currentPointName: "中国达州市通川区",
+        //当前位置经纬度
+        currentPoint: {
+          lat: "",
+          lon: ""
         },
-        initParkingMarkes(weight, height, image, lon, lat, title) {
-            let that = this;
-            //图标标记点
-            let pointicon = new AMap.Icon({
-                size: new AMap.Size(weight, height), // 图标尺寸
-                image: image, // Icon的图像
-                imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等
-                imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
-            });
-            // 创建一个 Marker 实例:
-            var pointmarker = new AMap.Marker({
-                position: new AMap.LngLat(lon, lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-                icon: pointicon,
-                title: title
-            });
-            that.parkMark.push(pointmarker);
-            // 将创建的点标记添加到已有的地图实例:
-            that.map.add(pointmarker);
+        //起点位置
+        startPointName: "中国达州市通川区",
+        //起点位置经纬度
+        startPoint: {
+          lon: "114.03922119568348",
+          lat: "32.49746162481379"
         },
-        //创建离线和停车的标记
-        initLeaveMarkes(weight, height, image, lon, lat, title) {
-        let that = this;
-        //图标标记点
-        let pointicon = new AMap.Icon({
-            size: new AMap.Size(weight, height), // 图标尺寸
-            image: image, // Icon的图像
-            imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等
-            imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
+        //终点位置
+        endPointName: "中国成都萧山",
+        //终点位置经纬度
+        endPoint: {
+          lon: "115.96995737755431",
+          lat: "33.01595479752097"
+        },
+        //自定义标记
+        content: [],
+        //异常位置
+        abnormalLocation: []
+      },
+      listPath: [],
+      //组件
+      pathSimplifierIns: {},
+      pathNavigator: {},
+      //地图解析
+      geocoder: null,
+      currentPointName: ""
+    };
+  },
+  created() {
+    let that = this;
+    that.initData(that.orderNumber);
+  },
+  mounted() {},
+  methods: {
+    //停车时间改变
+    changeParkingTime() {
+      let that = this;
+      //清除之前的停车点
+      that.hideParkingMark();
+      //计算时间的点
+      let calculationPoint = null;
+      that.listPath[0].runRoute.forEach(function(item, indexOf) {
+        if (indexOf + 1 < that.listPath[0].runRoute.length) {
+          //判断calculationPoint是否为空,如果是空的说明当前没有在计算停车时间
+          if (calculationPoint == null && item.spd == "0.0") {
+            calculationPoint = item;
+          } else if (calculationPoint != null && item.spd != "0.0") {
+            let beforeTime = that.stringToDate(calculationPoint.gtm);
+            let item2 = that.listPath[0].runRoute[indexOf];
+            let afterTime = that.stringToDate(item2.gtm);
+            let second = afterTime - beforeTime;
+            if (second > that.parkingTime) {
+              let message = "停车:" + second / 60000;
+              that.initParkingMarkes(
+                20,
+                35,
+                require("@/assets/img/park.png"),
+                calculationPoint.lon,
+                calculationPoint.lat,
+                message.split(".")[0] + "分钟"
+              );
+            }
+            calculationPoint = null;
+          }
+        }
+      });
+    },
+    //字符串转为Date
+    stringToDate(dateString) {
+      console.log(dateString);
+      let dateStr = dateString
+        .replace("年", "-")
+        .replace("月", "-")
+        .replace("日", "");
+      return Date.parse(dateStr);
+    },
+    //停车所有离线图标
+    hideParkingMark() {
+      let that = this;
+
+      that.parkMark.forEach(function(item, indexOf) {
+        item.hide();
+      });
+    },
+    //离线时间改变时获得超过时间的点信息
+    changeLeaveTime() {
+      let that = this;
+      //关闭所有图标
+      that.hideLeaveMark();
+      that.listPath[0].runRoute.forEach(function(item, indexOf) {
+        if (indexOf + 1 < that.listPath[0].runRoute.length) {
+          let beforeTime = that.stringToDate(item.gtm);
+          let item2 = that.listPath[0].runRoute[indexOf + 1];
+          let afterTime = that.stringToDate(item2.gtm);
+          let second = afterTime - beforeTime;
+          if (second > that.leaveTime) {
+            let message = "离线:" + second / 60000;
+            that.initLeaveMarkes(
+              20,
+              35,
+              require("@/assets/img/leave.png"),
+              item2.lon,
+              item2.lat,
+              message.split(".")[0] + "分钟"
+            );
+          }
+        }
+      });
+    },
+    //关闭所有离线图标
+    hideLeaveMark() {
+      let that = this;
+      that.leaveMark.forEach(function(item, indexOf) {
+        item.hide();
+      });
+    },
+    slow() {
+      console.log("slow");
+      let that = this;
+      that.pathNavigator.setSpeed(1000);
+    },
+    middle() {
+      console.log("middle");
+      let that = this;
+      that.pathNavigator.setSpeed(10000);
+    },
+    fast() {
+      console.log("fast");
+      let that = this;
+      that.pathNavigator.setSpeed(100000);
+    },
+    play() {
+      let that = this;
+      that.pathNavigator.resume();
+    },
+    stop() {
+      let that = this;
+      that.pathNavigator.pause();
+    },
+    addIndex() {
+      let that = this;
+      let increment = that.listPath[0].runPath.length * 0.1;
+      that.pathNavigator.start(
+        (that.point + increment) % that.listPath[0].runPath.length
+      );
+    },
+    ///che
+    navgControl() {},
+    hideFormat(value) {
+      let that = this;
+      that.sliderVal = value;
+    },
+    initParkingMarkes(weight, height, image, lon, lat, title) {
+      let that = this;
+      //图标标记点
+      let pointicon = new AMap.Icon({
+        size: new AMap.Size(weight, height), // 图标尺寸
+        image: image, // Icon的图像
+        imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等
+        imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
+      });
+      // 创建一个 Marker 实例:
+      var pointmarker = new AMap.Marker({
+        position: new AMap.LngLat(lon, lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+        icon: pointicon,
+        title: title
+      });
+      that.parkMark.push(pointmarker);
+      // 将创建的点标记添加到已有的地图实例:
+      that.map.add(pointmarker);
+    },
+    //创建离线和停车的标记
+    initLeaveMarkes(weight, height, image, lon, lat, title) {
+      let that = this;
+      //图标标记点
+      let pointicon = new AMap.Icon({
+        size: new AMap.Size(weight, height), // 图标尺寸
+        image: image, // Icon的图像
+        imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等
+        imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
+      });
+      // 创建一个 Marker 实例:
+      var pointmarker = new AMap.Marker({
+        position: new AMap.LngLat(lon, lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+        icon: pointicon,
+        title: title
+      });
+      that.leaveMark.push(pointmarker);
+      // 将创建的点标记添加到已有的地图实例:
+      that.map.add(pointmarker);
+    },
+    initData(orderNumber) {
+      let that = this;
+      that.axios
+        .post("/api/v1/otms/fullPath?orderNumber=" + orderNumber)
+        .then(res => {
+          console.log(res.data);
+          if (res.data.data == "-1") {
+            this.$message.error("自提车辆无权查看!");
+          } else if (res.data.data.startAndEndRoutes != null) {
+            that.listPath = res.data.data.startAndEndRoutes;
+            that.initMap();
+          } else {
+            that.listPath = [];
+            this.$message.error("车辆没有开启GPS");
+          }
         });
-        // 创建一个 Marker 实例:
-        var pointmarker = new AMap.Marker({
-            position: new AMap.LngLat(lon, lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-            icon: pointicon,
-            title: title
+    },
+    endline() {
+      let that = this;
+      that.initPolyline(that.listPath[0].estimatePath, "#FF0000");
+    },
+    //创建起点终点当前点
+    threeMarker() {
+      let that = this;
+      that.listPath.forEach((element, index) => {
+        //开始标记点
+        if (element.startPoint.lon != "" && element.startPoint.lat != "") {
+          that.initMarkes(
+            20,
+            35,
+            require("@/assets/img/start.png"),
+            element.startPoint.lon,
+            element.startPoint.lat,
+            "起点"
+          );
+        }
+        //当前点
+        that.getCurrentPointName([
+          element.runRoute[element.runRoute.length - 1].lon,
+          element.runRoute[element.runRoute.length - 1].lat
+        ]);
+        //结束标记点
+        if (element.endPoint.lon != "" && element.endPoint.lat != "") {
+          that.initMarkes(
+            20,
+            35,
+            require("@/assets/img/end.png"),
+            element.endPoint.lon,
+            element.endPoint.lat,
+            "终点"
+          );
+        }
+      });
+    },
+    //获得结束地址
+    getCurrentPointName(lnglatXY) {
+      let that = this;
+      that.geocoder.getAddress(lnglatXY, function(status, result) {
+        if (status === "complete" && result.info === "OK") {
+          that.currentPointName = result.regeocode.formattedAddress;
+          that.initCustomMarkes(
+            that.capacityNumber,
+            "位置:" +
+              that.currentPointName +
+              "<br/>" +
+              "距离:" +
+              that.listPath[0].miled,
+            lnglatXY[0],
+            lnglatXY[1]
+          );
+        }
+      });
+    },
+    //defualt数据
+    defaultDate() {
+      // let that=this;
+      // that.pathNavigator.start(that.listPath[0].runPath.length)
+      // that.pathNavigator.pause();
+    },
+    //初始化地图
+    initMap() {
+      lazyAMapApiLoaderInstance.load().then(() => {
+        let that = this;
+        that.map = new AMap.Map("amap-container", {
+          //设置地图容器id
+          viewMode: "2D", //是否为2D地图模式
+          zoom: 10, //初始化地图级别
+          center: [105.602725, 37.076636] //初始化地图中心点位置
         });
-        that.leaveMark.push(pointmarker);
-        // 将创建的点标记添加到已有的地图实例:
-        that.map.add(pointmarker);
-        },
-        initData(orderNumber){
-            let that=this;
-             that.axios.post("/api/v1/otms/fullPath?orderNumber="+orderNumber).then((res) => {
-                 console.log(res.data)
-                 if(res.data.data=='-1'){
-                     this.$message.error('自提车辆无权查看!');
-                 }else if(res.data.data.startAndEndRoutes!=null){
-                     that.listPath=res.data.data.startAndEndRoutes
-                    that.initMap();
-                 }else{
-                     that.listPath=[];
-                     this.$message.error('车辆没有开启GPS');
-                 }
-            });
-        },
-        endline(){
-            let that=this;
-            that.initPolyline(that.listPath[0].estimatePath,"#FF0000");
-        },
-        //创建起点终点当前点
-        threeMarker(){
-            let that=this;
-            that.listPath.forEach((element,index) => {
-                //开始标记点
-                if(element.startPoint.lon!=''&&element.startPoint.lat!=''){
-                    that.initMarkes(20,35,require('@/assets/img/start.png'),element.startPoint.lon,element.startPoint.lat,'起点');
-                }
-                //当前点
-                that.getCurrentPointName([element.runRoute[element.runRoute.length-1].lon,element.runRoute[element.runRoute.length-1].lat])
-                //结束标记点
-                if(element.endPoint.lon!=''&&element.endPoint.lat!=''){
-                    that.initMarkes(20,35,require('@/assets/img/end.png'),element.endPoint.lon,element.endPoint.lat,'终点');
-                }
-            });
-        },
-        //获得结束地址
-        getCurrentPointName(lnglatXY){
-            let that=this;
-            that.geocoder.getAddress(lnglatXY, function(status, result) {
-                if (status === 'complete' && result.info === 'OK') {
-                    that.currentPointName = result.regeocode.formattedAddress;
-                    that.initCustomMarkes(that.capacityNumber,"位置:"+that.currentPointName+"<br/>"+"距离:"+that.listPath[0].miled,lnglatXY[0],lnglatXY[1])
-                }
-            });  
-        },
-        //defualt数据
-        defaultDate(){
-            // let that=this;
-            // that.pathNavigator.start(that.listPath[0].runPath.length)
-            // that.pathNavigator.pause();
-            
-        },
-        //初始化地图
-        initMap(){
-            lazyAMapApiLoaderInstance.load().then(() => {
-                let that=this;
-                that.map = new AMap.Map("amap-container",{  //设置地图容器id
-                    viewMode:"2D",    //是否为2D地图模式
-                    zoom:10,           //初始化地图级别
-                    center:[105.602725,37.076636], //初始化地图中心点位置
-                });
-                that.initGeocoder();
-                that.initPathSimplifier();
-                that.threeMarker();
-                //that.initCustomMarkes(that.capacityNumber+"("+that.listPath[0].miled+")",that.listPath[0].currentPointName,that.listPath[0].currentPoint.lon,that.listPath[0].currentPoint.lat)
-                that.endline();
-                
-            });
-        },
-        initCustomMarkes(title,details,lon,lat){
-             let that=this;
-            //自定义窗体内容
-            var content = [
-                "<div  style='top:1px;width: 180px; background-color: rgba(22, 160, 133, 1);' ><font color='white'>"+title+"</font>",
-                "<div style='background-color:(22, 160, 133, 1); ;'><font color='white'>"+details+"</font></div></div>"
-            ];
-            // 创建 infoWindow 实例	
-            var infoWindow = new AMap.InfoWindow({
-                content: content.join("<br>")  //传入 dom 对象,或者 html 字符串
-            });
-            // 打开信息窗体
-            infoWindow.open(that.map,[lon,lat]);
-        },
-        initPolyline(path,color){
-            let that=this;
-             //预计轨迹
-            var endLine = new AMap.Polyline({
-                map:that.map,
-                path: path,
-                isOutline: true,
-                outlineColor: color,
-                borderWeight: 0,
-                strokeColor: "#FF0000", 
-                strokeOpacity: 1,
-                strokeWeight: 5,
-                // 折线样式还支持 'dashed'
-                strokeStyle: "solid",
-                // strokeStyle是dashed时有效
-                strokeDasharray: [10, 5],
-                lineJoin: 'round',
-                lineCap: 'round',
-                zIndex: 50,
-            })
-            that.map.setFitView([[ endLine ]])
-        },
-        //创建简单的标记
-        initMarkes(weight,height,image,lon,lat,title){
-            let that=this;
-            //图标标记点
-            let pointicon = new AMap.Icon({
-                size: new AMap.Size(weight, height), // 图标尺寸
-                image: image, // Icon的图像
-                imageOffset: new AMap.Pixel(0,0), // 图像相对展示区域的偏移量,适于雪碧图等
-                imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
-            });
-            // 创建一个 Marker 实例:
-            var pointmarker = new AMap.Marker({
-                position: new AMap.LngLat(lon, lat),   // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-                icon: pointicon, 
-                title: title
-            });
-            // 将创建的点标记添加到已有的地图实例:
-            that.map.add(pointmarker);
-        },
+        that.initGeocoder();
+        that.initPathSimplifier();
+        that.threeMarker();
+        //that.initCustomMarkes(that.capacityNumber+"("+that.listPath[0].miled+")",that.listPath[0].currentPointName,that.listPath[0].currentPoint.lon,that.listPath[0].currentPoint.lat)
+        that.endline();
+      });
+    },
+    initCustomMarkes(title, details, lon, lat) {
+      let that = this;
+      //自定义窗体内容
+      var content = [
+        "<div  style='top:1px;width: 180px; background-color: rgba(22, 160, 133, 1);' ><font color='white'>" +
+          title +
+          "</font>",
+        "<div style='background-color:(22, 160, 133, 1); ;'><font color='white'>" +
+          details +
+          "</font></div></div>"
+      ];
+      // 创建 infoWindow 实例
+      infoWindow = new AMap.InfoWindow({
+        content: content.join("<br>") //传入 dom 对象,或者 html 字符串
+      });
+      // 打开信息窗体
+      infoWindow.open(that.map, [lon, lat]);
+    },
+    // 关闭信息窗口
+    closeinfo() {
+      infoWindow.close();
+    },
+    openInfo() {
+      let lon = null;
+      let lat = null;
+      console.log(this.listPath);
+      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]);
+    },
+    initPolyline(path, color) {
+      let that = this;
+      //预计轨迹
+      var endLine = new AMap.Polyline({
+        map: that.map,
+        path: path,
+        isOutline: true,
+        outlineColor: color,
+        borderWeight: 0,
+        strokeColor: "#FF0000",
+        strokeOpacity: 1,
+        strokeWeight: 5,
+        // 折线样式还支持 'dashed'
+        strokeStyle: "solid",
+        // strokeStyle是dashed时有效
+        strokeDasharray: [10, 5],
+        lineJoin: "round",
+        lineCap: "round",
+        zIndex: 50
+      });
+      that.map.setFitView([[endLine]]);
+    },
+    //创建简单的标记
+    initMarkes(weight, height, image, lon, lat, title) {
+      let that = this;
+      //图标标记点
+      let pointicon = new AMap.Icon({
+        size: new AMap.Size(weight, height), // 图标尺寸
+        image: image, // Icon的图像
+        imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等
+        imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
+      });
+      // 创建一个 Marker 实例:
+      var pointmarker = new AMap.Marker({
+        position: new AMap.LngLat(lon, lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+        icon: pointicon,
+        title: title
+      });
+      // 将创建的点标记添加到已有的地图实例:
+      that.map.add(pointmarker);
+    },
+    //创建轨迹和巡航器
+    initPathSimplifier() {
+      let that = this;
+      // ...你的操作
+      new AMapUI.load(["ui/misc/PathSimplifier"], PathSimplifier => {
+        if (!PathSimplifier.supportCanvas) {
+          alert("当前环境不支持 Canvas!");
+          return;
+        }
         //创建轨迹和巡航器
-        initPathSimplifier() {
-            let that=this;
-            // ...你的操作
-            new AMapUI.load(['ui/misc/PathSimplifier'], (PathSimplifier) => {
-                if (!PathSimplifier.supportCanvas) {
-                    alert('当前环境不支持 Canvas!')
-                    return
-                }
-                //创建轨迹和巡航器
-                // 创建组件实例
-                that.pathSimplifierIns = new PathSimplifier({
-                    map: that.map,
-                    zIndex: 100, // 图层叠加顺序
-                    data: that.listPath, // 巡航路径
-                    // 获取巡航路径中的路径坐标数组
-                    getPath: (pathData, pathIndex) => {
-                        return pathData.runPath;
-                    },
-                    //鼠标悬浮停时显示消息
-                    getHoverTitle: function(pathData, pathIndex, pointIndex) {
-                        //返回鼠标悬停时显示的信息
-                        if (pointIndex >= 0) {
-                            if(pathData.runRoute[pointIndex].gtm!=='undefined'){
-                                 //鼠标悬停在某个轨迹节点上
-                                return pathData.runRoute[pointIndex].gtm + ',速度'+ pathData.runRoute[pointIndex].spd+'千米/小时' ;
-                            }
-                        }
-                    },
-                    //设置轨迹样式
-                    renderOptions: {
-                        //轨迹线的样式
-                        pathLineStyle: {
-                            strokeStyle: 'black',
-                            lineWidth: 6,
-                            dirArrowStyle: true
-                        }
-                    }
-                })
-                // 创建巡航器
-                that.pathNavigator = that.pathSimplifierIns.createPathNavigator(0, {
-                    loop: true, // 是否循环
-                    speed: that.speed ,// 速度(km/h)
-                    pathNavigatorStyle: {
-                        width: 20,
-                        height: 40,
-                        content:PathSimplifier.Render.Canvas.getImageContent( require('@/assets/img/smallcar.png'), onload, onerror),
-                        strokeStyle: null,
-                        fillStyle: null
-                    }
-                })
-                //开启巡航
-                that.pathNavigator.start()
-                that.defaultDate();
-                
-                //开始事件
-                that.pathNavigator.on("start resume", function() {
-                    // that.navgtr._startTime = Date.now();
-                    // that.navgtr._startDist = this.getMovedDistance();
-                });
-                //暂停
-                that.pathNavigator.on("stop pause", function() {
-                    // that.navgtr._movedTime = Date.now() - that.navgtr._startTime;
-                    // that.navgtr._movedDist = this.getMovedDistance() - that.navgtr._startDist;
-                });
-                that.pathNavigator.on('move', function (data,value) {
-                    that.updateLable(value)
-                });
-            })
-        },
-        updateLable(value){
-            let that=this;
-            that.point=value.dataItem.pointIndex;
-            that.runRoute=value.dataItem.pathData.runRoute[that.point];
-            that.sliderVal=(value.dataItem.pointIndex/value.dataItem.pathData.runRoute.length)*100;
-        },
-        changeSpeed(value){
-            // console.log(value)
-            // let that=this;
-            // that.times=value;
-            
-        },
-        playIcon(){
-            console.log("nihoa")
-        },
-        //逆解码函数
-        initGeocoder(){
-            let that=this;
-            console.log("initGeocoder") ;
-            AMap.plugin('AMap.Geocoder',function(){   
-                that.geocoder = new AMap.Geocoder({
-                    radius: 1000,
-                    extensions: "all"
-                });  
-                
-                console.log(that.geocoder)    
-            })    
-        },
-                  
+        // 创建组件实例
+        that.pathSimplifierIns = new PathSimplifier({
+          map: that.map,
+          zIndex: 100, // 图层叠加顺序
+          data: that.listPath, // 巡航路径
+          // 获取巡航路径中的路径坐标数组
+          getPath: (pathData, pathIndex) => {
+            return pathData.runPath;
+          },
+          //鼠标悬浮停时显示消息
+          getHoverTitle: function(pathData, pathIndex, pointIndex) {
+            //返回鼠标悬停时显示的信息
+            if (pointIndex >= 0) {
+              if (pathData.runRoute[pointIndex].gtm !== "undefined") {
+                //鼠标悬停在某个轨迹节点上
+                return (
+                  pathData.runRoute[pointIndex].gtm +
+                  ",速度" +
+                  pathData.runRoute[pointIndex].spd +
+                  "千米/小时"
+                );
+              }
+            }
+          },
+          //设置轨迹样式
+          renderOptions: {
+            //轨迹线的样式
+            pathLineStyle: {
+              strokeStyle: "black",
+              lineWidth: 6,
+              dirArrowStyle: true
+            }
+          }
+        });
+        // 创建巡航器
+        that.pathNavigator = that.pathSimplifierIns.createPathNavigator(0, {
+          loop: true, // 是否循环
+          speed: that.speed, // 速度(km/h)
+          pathNavigatorStyle: {
+            width: 20,
+            height: 40,
+            content: PathSimplifier.Render.Canvas.getImageContent(
+              require("@/assets/img/smallcar.png"),
+              onload,
+              onerror
+            ),
+            strokeStyle: null,
+            fillStyle: null
+          }
+        });
+        //开启巡航
+        that.pathNavigator.start();
+        that.defaultDate();
+
+        //开始事件
+        that.pathNavigator.on("start resume", function() {
+          // that.navgtr._startTime = Date.now();
+          // that.navgtr._startDist = this.getMovedDistance();
+        });
+        //暂停
+        that.pathNavigator.on("stop pause", function() {
+          // that.navgtr._movedTime = Date.now() - that.navgtr._startTime;
+          // that.navgtr._movedDist = this.getMovedDistance() - that.navgtr._startDist;
+        });
+        that.pathNavigator.on("move", function(data, value) {
+          that.updateLable(value);
+        });
+      });
+    },
+    updateLable(value) {
+      let that = this;
+      that.point = value.dataItem.pointIndex;
+      that.runRoute = value.dataItem.pathData.runRoute[that.point];
+      that.sliderVal =
+        (value.dataItem.pointIndex / value.dataItem.pathData.runRoute.length) *
+        100;
+    },
+    changeSpeed(value) {
+      // console.log(value)
+      // let that=this;
+      // that.times=value;
+    },
+    playIcon() {
+      console.log("nihoa");
+    },
+    //逆解码函数
+    initGeocoder() {
+      let that = this;
+      console.log("initGeocoder");
+      AMap.plugin("AMap.Geocoder", function() {
+        that.geocoder = new AMap.Geocoder({
+          radius: 1000,
+          extensions: "all"
+        });
+
+        console.log(that.geocoder);
+      });
     }
+  }
 };
 </script>
 <style>
-.mapcontroller{
-    width: 250px; height: 260px; 
-    background: white;
-   position: absolute;z-index:99;top:0;left:0
+.mapcontroller {
+  width: 250px;
+  height: 260px;
+  background: white;
+  position: absolute;
+  z-index: 99;
+  top: 0;
+  left: 0;
 }
-.container{
-    width: 100%;
-	height: 100%;
-    
+.container {
+  width: 100%;
+  height: 100%;
 }
 .item_details {
-    display: block;
-    margin-top: 20px;
-    position: relative;
-    left: 30px;
-    width: 200px;
-    height: 0px;
+  display: block;
+  margin-top: 20px;
+  position: relative;
+  left: 30px;
+  width: 200px;
+  height: 0px;
 }
 #amap-container {
-    position: relative;
-	width: 100%;
-	height: 100%;
-	overflow: hidden;
-	margin: 0;
-	font-family: "微软雅黑";
+  position: relative;
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  margin: 0;
+  font-family: "微软雅黑";
 }
 .driving_information2 {
-    position: relative;
-    top: 70px;
+  position: relative;
+  top: 70px;
 }
 .driving_information3 {
-    position: absolute;z-index:99;top:0;left:0;
-    position: relative;
-    top: 50px;
+  position: absolute;
+  z-index: 99;
+  top: 0;
+  left: 0;
+  position: relative;
+  top: 50px;
 }
 
 /* 进度条 */
 .mySlider {
-
-    width: 150px;
-    height: 20px;
-    display: inline-block;
-    position: relative;
-    left: 32px;
+  width: 150px;
+  height: 20px;
+  display: inline-block;
+  position: relative;
+  left: 32px;
 }
 .play {
-    position: relative;
-    left: 28px;
+  position: relative;
+  left: 28px;
 }
-.quickly
-{
-    float: right;
-    position: relative;
-    left: -20px;
-    top: 10px;
+.quickly {
+  float: right;
+  position: relative;
+  left: -20px;
+  top: 10px;
 }
 .pause {
-    position: relative;
-    left: 28px;
+  position: relative;
+  left: 28px;
 }
-.passed-time{
-    position: relative;
-    left: 5px;
+.passed-time {
+  position: relative;
+  left: 5px;
 }
-.end-time{
-    position: relative;
-    left: 5px;
+.end-time {
+  position: relative;
+  left: 5px;
 }
 .map-times {
-    position: relative;
-    background-color: red;
-    width: 40px;
+  position: relative;
+  background-color: red;
+  width: 40px;
 }
-
-
-
-</style>
+</style>
+<style lang="scss" scoped>
+.btnx {
+  z-index: 1000;
+  position: fixed;
+  bottom: 10px;
+  right: 10px;
+}
+</style>

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

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

+ 299 - 217
src/views/sale/components/transport_appointment/openDistribution.vue

@@ -2,91 +2,113 @@
 <template>
   <div class="steel_inbound">
     <div class="sache">
-      <el-input
-        placeholder="请输入内容"
-        v-model="inputText"
-        clearable>
+      <el-input placeholder="请输入内容" v-model="inputText" clearable>
       </el-input>
       <el-button type="primary" class="btn" @click="onclick1">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-button v-if="activeName=='first'" type="primary" @click="receive">
+      <el-button v-if="activeName == 'first'" type="primary" @click="receive">
         <i></i>批量接收订单
       </el-button>
-      <el-button v-if="activeName=='first'" type="primary" @click="refuse">
+      <el-button v-if="activeName == 'first'" type="primary" @click="refuse">
         <i></i>批量拒绝订单
       </el-button>
+      <el-button v-if="activeName == 'second'" type="primary" @click="close">
+        <i></i>批量关闭订单
+      </el-button>
     </div>
     <div class="table">
       <el-tabs v-model="activeName" @tab-click="handleClick">
-      <!-- 未抢单 -->
-      	<el-tab-pane label="未接收" name="first">
-						  <dilTable v-bind.sync="first" ref="table" @selection-change="currentSelectChange">
-             <el-table-column fixed="right" label="操作" width="120">
-        <template slot-scope="scope">
-          <el-button @click="detailclick(scope.row)" type="text" size="small">
-            物资详情
-          </el-button>
-        </template>
-      </el-table-column>
-        <!-- 物资详情抽屉 -->
-        <el-table-column type="expand" width="1">
-          <template slot-scope="props">
-            <el-form label-position="center" inline class="demo-table-expand">
-              <div v-if="false">{{ props }}</div>
-              <div>
-                <el-table :data="tableData" border >
-                  <el-table-column
-                    v-for="(item, i) in tableHead"
-                    :key="i"
-                    :prop="item.prop"
-                    :label="item.label"
-                    :width="item.width"
-                  ></el-table-column>
-                </el-table>
-              </div>
-            </el-form>
-          </template>
-        </el-table-column>
-      </dilTable>
-
-		</el-tab-pane>
-     	<el-tab-pane label="已接收" name="second">
-				<dilTable v-bind.sync="second" ref="table1">
-          <el-table-column fixed="right" label="操作" width="120">
-            <template slot-scope="scope">
-          <el-button @click="dispatch(scope)  " type="text" size="small">
-            派单
-          </el-button>
-          <el-button @click="detailclick1(scope.row)" type="text" size="small">
-            物资详情
-          </el-button>
-            </template>
-      </el-table-column>
+        <!-- 未抢单 -->
+        <el-tab-pane label="未接收" name="first">
+          <dilTable
+            v-bind.sync="first"
+            ref="table"
+            @selection-change="currentSelectChange"
+          >
+            <el-table-column fixed="right" label="操作" width="120">
+              <template slot-scope="scope">
+                <el-button
+                  @click="detailclick(scope.row)"
+                  type="text"
+                  size="small"
+                >
+                  物资详情
+                </el-button>
+              </template>
+            </el-table-column>
+            <!-- 物资详情抽屉 -->
+            <el-table-column type="expand" width="1">
+              <template slot-scope="props">
+                <el-form
+                  label-position="center"
+                  inline
+                  class="demo-table-expand"
+                >
+                  <div v-if="false">{{ props }}</div>
+                  <div>
+                    <el-table :data="tableData" border>
+                      <el-table-column
+                        v-for="(item, i) in tableHead"
+                        :key="i"
+                        :prop="item.prop"
+                        :label="item.label"
+                        :width="item.width"
+                      ></el-table-column>
+                    </el-table>
+                  </div>
+                </el-form>
+              </template>
+            </el-table-column>
+          </dilTable>
+        </el-tab-pane>
+        <el-tab-pane label="已接收" name="second">
+          <dilTable
+            v-bind.sync="second"
+            ref="table1"
+            @selection-change="currentSelectChange1"
+          >
+            <el-table-column fixed="right" label="操作" width="120">
+              <template slot-scope="scope">
+                <el-button @click="dispatch(scope)" type="text" size="small">
+                  派单
+                </el-button>
+                <el-button
+                  @click="detailclick1(scope.row)"
+                  type="text"
+                  size="small"
+                >
+                  物资详情
+                </el-button>
+              </template>
+            </el-table-column>
 
-      <!-- 物资详情抽屉 -->
-        <el-table-column type="expand" width="1">
-          <template slot-scope="props">
-            <el-form label-position="center" inline class="demo-table-expand">
-              <div v-if="false">{{ props }}</div>
-              <div>
-                <el-table :data="tableData1" border >
-                  <el-table-column
-                    v-for="(item, i) in tableHead"
-                    :key="i"
-                    :prop="item.prop"
-                    :label="item.label"
-                    :width="item.width"
-                  ></el-table-column>
-                </el-table>
-              </div>
-            </el-form>
-          </template>
-        </el-table-column>
-      </dilTable>
-		</el-tab-pane>
-    </el-tabs>
-    
+            <!-- 物资详情抽屉 -->
+            <el-table-column type="expand" width="1">
+              <template slot-scope="props">
+                <el-form
+                  label-position="center"
+                  inline
+                  class="demo-table-expand"
+                >
+                  <div v-if="false">{{ props }}</div>
+                  <div>
+                    <el-table :data="tableData1" border>
+                      <el-table-column
+                        v-for="(item, i) in tableHead"
+                        :key="i"
+                        :prop="item.prop"
+                        :label="item.label"
+                        :width="item.width"
+                      ></el-table-column>
+                    </el-table>
+                  </div>
+                </el-form>
+              </template>
+            </el-table-column>
+          </dilTable>
+        </el-tab-pane>
+      </el-tabs>
     </div>
   </div>
 </template>
@@ -94,30 +116,27 @@
 <script>
 import { getCookie } from "@/utils/util.js";
 export default {
-  data(){
-    return{
+  data() {
+    return {
       drawer: false,
-      ssoId:null,
-			direction: 'rtl',
+      ssoId: null,
+      direction: "rtl",
       activeName: "first",
-      inputText:"",
-      dispatchId:null,
-      input:"",
+      inputText: "",
+      dispatchId: null,
+      input: "",
       //所有选中的车序号订单
       selectTruckOrder: [],
-      first:{
+      first: {
         // first请求数据的地址
         requestUrl: "",
-        selectionType: "select",
+        selectionType: "select"
       },
-      second:{
-        requestUrl:"",
-      },
-      third:{
-        requestUrl:"/api/v1/oms/getCapacityAndDriverList?apiId=246",
-        selectionType: "radio",
-				mapList: []      
+      second: {
+        requestUrl: "",
+        selectionType: "select"
       },
+      closeList: [],
       //记录旧的row对象(未接收)
       oldRow: "",
       //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未接收)
@@ -130,116 +149,162 @@ export default {
         {
           prop: "materialName",
           label: "物资名称",
-          width: 150,
+          width: 150
         },
         {
           prop: "specificationModel",
           label: "规格型号",
-          width: 150,
+          width: 150
         },
         {
           prop: "materialNumber",
           label: "物资件数",
-          width: 100,
+          width: 100
         },
         {
           prop: "materialWeight",
           label: "物资重量",
-          width: 100,
-        },
+          width: 100
+        }
       ],
       tableData: [],
-      tableData1: [],
-    }
+      tableData1: []
+    };
   },
-  created(){
-      this.firstGetRequestUrl();
-      this.secondGetRequestUrl();
+  created() {
+    this.firstGetRequestUrl();
+    this.secondGetRequestUrl();
   },
-  methods:{
-      handleClick(tab, event) {
+  methods: {
+    currentSelectChange1(selection) {
+      console.log(selection);
+      this.closeList = selection;
+    },
+    close() {
+      this.$confirm("是否将选中的订单批量关闭? 继续?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          //请求后端
+          this.axios
+            .post("/api/v1/ams/refuseDispatchSaleOrderList", this.closeList)
+            .then(res => {
+              if (res.data.code == 200) {
+                this.$message.success("关闭成功");
+                this.secondGetRequestUrl();
+              } else {
+                this.$message.error("关闭失败");
+              }
+            })
+            .catch(() => {
+              this.$message.error("关闭失败");
+            });
+        })
+        .catch(() => {
+          this.$message.info("取消关闭");
+        });
+    },
+    handleClick(tab, event) {
       console.log(tab, event);
     },
-    firstGetRequestUrl(){
-    if(getCookie("orgCode") == "chengyunshang"){
-      this.first.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId="+ getCookie('userId');
-    }else{
-     this.first.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId=" + this.ssoId;
-    }
-
+    firstGetRequestUrl() {
+      if (getCookie("orgCode") == "chengyunshang") {
+        this.first.requestUrl =
+          "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId=" +
+          getCookie("userId");
+      } else {
+        this.first.requestUrl =
+          "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId=" +
+          this.ssoId;
+      }
     },
-    secondGetRequestUrl(){
-    if(getCookie("orgCode") == "chengyunshang"){
-      this.second.requestUrl = "/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierSsoId="+ getCookie('userId');
-    }else{
-     this.second.requestUrl = "/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierSsoId=" + this.ssoId;
-    }
-
+    secondGetRequestUrl() {
+      if (getCookie("orgCode") == "chengyunshang") {
+        this.second.requestUrl =
+          "/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierSsoId=" +
+          getCookie("userId");
+      } else {
+        this.second.requestUrl =
+          "/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierSsoId=" +
+          this.ssoId;
+      }
     },
-    onclick1(){
-       if(this.activeName == "first"){
-         this.option1.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&con=" + this.input;
-      }else if
-        (this.activeName == "second"){
-        this.option2.requestUrl = "/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierId=1&con=" + this.input;
-    }
+    onclick1() {
+      if (this.activeName == "first") {
+        this.option1.requestUrl =
+          "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&con=" + this.input;
+      } else if (this.activeName == "second") {
+        this.option2.requestUrl =
+          "/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierId=1&con=" +
+          this.input;
+      }
     },
-    dispatch(scope){
-      this.dispatchId = scope.row.dispatchId
+    dispatch(scope) {
+      this.dispatchId = scope.row.dispatchId;
       this.$router.push("/openDistributionSection/" + scope.row.dispatchId);
     },
     // handleBtnClick1(){
-		// 		this.drawer=true
-		// 	},
+    // 		this.drawer=true
+    // 	},
     //车序号订单表格
-    currentSelectChange(select){
+    currentSelectChange(select) {
       this.selectTruckOrder = [];
       this.selectTruckOrder = select;
     },
     onclick() {
-        this.third.requestUrl =
+      this.third.requestUrl =
         "/api/v1/oms/getCapacityAndDriverList?apiId=246&con=" + this.input;
-      },
-      makeSure(){
-        this.$confirm("是否派发","提示",{
-          confirmButtonText:"确定",
-          cancelButtonText:"取消",
-          type:"warning",
-          center:true,
-        })
+    },
+    makeSure() {
+      this.$confirm("是否派发", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true
+      })
         .then(() => {
           //初始化承运商SsoId
-          var carrierSsoId = '';
-          if(getCookie("orgCode") == "chengyunshang"){
-            carrierSsoId =  getCookie('userId');
-          }else{
+          var carrierSsoId = "";
+          if (getCookie("orgCode") == "chengyunshang") {
+            carrierSsoId = getCookie("userId");
+          } else {
             carrierSsoId = null;
           }
-        this.axios.post("/api/v1/oms/addAppTruckOrder?orderType=" + 1 + 
-        "&carrierId="+ carrierSsoId +"&dispatchId=" + this.dispatchId 
-        + "&capacityNumber=" + this.mapList.capacityNumber)
-        .then((res) => {
-          if(res.data.code == 200){
-            this.$message({
-              type:"success",
-              message:"派单成功!",
-            });
-            this.$router.go(0);
-          } else {
-            this.$message({
+          this.axios
+            .post(
+              "/api/v1/oms/addAppTruckOrder?orderType=" +
+                1 +
+                "&carrierId=" +
+                carrierSsoId +
+                "&dispatchId=" +
+                this.dispatchId +
+                "&capacityNumber=" +
+                this.mapList.capacityNumber
+            )
+            .then(res => {
+              if (res.data.code == 200) {
+                this.$message({
+                  type: "success",
+                  message: "派单成功!"
+                });
+                this.$router.go(0);
+              } else {
+                this.$message({
                   message: "删除失败",
-                  type: "warning",
+                  type: "warning"
                 });
-          }
+              }
+            });
         })
-        }) .catch(() => {
+        .catch(() => {
           this.$message({
             type: "info",
-            message: "派发操作已取消!",
+            message: "派发操作已取消!"
           });
         });
-       
-      },
+    },
 
     // -------查看物资详情(未接收)
     detailclick(row) {
@@ -269,8 +334,8 @@ export default {
     // 根据销售订单物资中间表id查询物资信息
     getMaterial(dispatchId) {
       this.axios
-        .post("/api/v1/ams/getDispatchMaterialList?dispatchId="+dispatchId)
-        .then((res) => {
+        .post("/api/v1/ams/getDispatchMaterialList?dispatchId=" + dispatchId)
+        .then(res => {
           this.tableData = res.data.data;
         });
     },
@@ -300,62 +365,72 @@ export default {
       this.oldRow1 = row;
       // 根据销售订单物资中间表id查询物资信息
       this.axios
-        .post("/api/v1/ams/getDispatchMaterialList?dispatchId="+row.dispatchId)
-        .then((res) => {
+        .post(
+          "/api/v1/ams/getDispatchMaterialList?dispatchId=" + row.dispatchId
+        )
+        .then(res => {
           this.tableData1 = res.data.data;
         });
     },
 
     //接收所有已选中的订单
-    receive(){
+    receive() {
       this.$confirm("是否接收已选中的订单", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-        center: true,
+        center: true
       })
         .then(() => {
           //初始化承运商SsoId
-          var carrierSsoId = '';
-          if(getCookie("orgCode") == "chengyunshang"){
-            carrierSsoId =  getCookie('userId');
-          }else{
+          var carrierSsoId = "";
+          if (getCookie("orgCode") == "chengyunshang") {
+            carrierSsoId = getCookie("userId");
+          } else {
             carrierSsoId = null;
           }
           //所有选中的分派Id
           var dispatchIdList = [];
-          this.selectTruckOrder.forEach((item) => {
-              //初始化mapItem
-              var mapItem = {
-                //分派Id
-                dispatchId : 0,
-              }
-              mapItem.dispatchId = item.dispatchId;
-              dispatchIdList.push(mapItem);
-          })
+          this.selectTruckOrder.forEach(item => {
+            //初始化mapItem
+            var mapItem = {
+              //分派Id
+              dispatchId: 0
+            };
+            mapItem.dispatchId = item.dispatchId;
+            dispatchIdList.push(mapItem);
+          });
           //保存承运商SsoId和所有选中的分派Id
           let map = {
-            carrierSsoId : carrierSsoId,
-            mapList : dispatchIdList
-          }
+            carrierSsoId: carrierSsoId,
+            mapList: dispatchIdList
+          };
           //请求后端
           this.axios
-            .post("/api/v1/ams/lockDispatchSaleOrderList",map)
-            .then((res) => {
+            .post("/api/v1/ams/lockDispatchSaleOrderList", map)
+            .then(res => {
               if (res.data.code == 200) {
                 this.$message({
                   type: "success",
-                  message: "接收成功!",
-                });     
-                if(getCookie("orgCode") == "chengyunshang"){
-                  this.first.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId="+ getCookie('userId')+"&i="+new Date();
-                }else{
-                this.first.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId=" + this.ssoId+"&i="+new Date();
+                  message: "接收成功!"
+                });
+                if (getCookie("orgCode") == "chengyunshang") {
+                  this.first.requestUrl =
+                    "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId=" +
+                    getCookie("userId") +
+                    "&i=" +
+                    new Date();
+                } else {
+                  this.first.requestUrl =
+                    "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId=" +
+                    this.ssoId +
+                    "&i=" +
+                    new Date();
                 }
               } else {
                 this.$message({
                   message: "接单失败,请联系管理员!",
-                  type: "warning",
+                  type: "warning"
                 });
               }
             });
@@ -363,48 +438,56 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "接单操作已取消!",
+            message: "接单操作已取消!"
           });
         });
     },
     //拒绝所有已选中的订单
-    refuse(){
+    refuse() {
       this.$confirm("是否拒绝已选中的订单", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-        center: true,
+        center: true
       })
         .then(() => {
           //所有选中的分派Id
           var mapList = [];
-          this.selectTruckOrder.forEach((item) => {
-              //初始化mapItem
-              var mapItem = {
-                //分派Id
-                dispatchId : 0,
-              }
-              mapItem.dispatchId = item.dispatchId;
-              mapList.push(mapItem);
-          })
+          this.selectTruckOrder.forEach(item => {
+            //初始化mapItem
+            var mapItem = {
+              //分派Id
+              dispatchId: 0
+            };
+            mapItem.dispatchId = item.dispatchId;
+            mapList.push(mapItem);
+          });
           //请求后端
           this.axios
-            .post("/api/v1/ams/refuseDispatchSaleOrderList",mapList)
-            .then((res) => {
+            .post("/api/v1/ams/refuseDispatchSaleOrderList", mapList)
+            .then(res => {
               if (res.data.code == 200) {
                 this.$message({
                   type: "success",
-                  message: "拒绝成功!",
-                });     
-                if(getCookie("orgCode") == "chengyunshang"){
-                  this.first.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId="+ getCookie('userId')+"&i="+new Date();
-                }else{
-                this.first.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId=" + this.ssoId+"&i="+new Date();
+                  message: "拒绝成功!"
+                });
+                if (getCookie("orgCode") == "chengyunshang") {
+                  this.first.requestUrl =
+                    "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId=" +
+                    getCookie("userId") +
+                    "&i=" +
+                    new Date();
+                } else {
+                  this.first.requestUrl =
+                    "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId=" +
+                    this.ssoId +
+                    "&i=" +
+                    new Date();
                 }
               } else {
                 this.$message({
                   message: "拒绝失败,请联系管理员!",
-                  type: "error",
+                  type: "error"
                 });
               }
             });
@@ -412,18 +495,17 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "拒绝操作已取消!",
+            message: "拒绝操作已取消!"
           });
         });
     }
-
   }
-}
+};
 </script>
 
 <style lang="scss" scode>
-.steel_inbound{
-  .sache{
+.steel_inbound {
+  .sache {
     padding: 1.25rem 0.375rem;
     .el-input {
       width: 20%;
@@ -431,7 +513,7 @@ export default {
     }
   }
 }
-.button-box{
+.button-box {
   display: flex;
   text-align: center;
   align-items: center;
@@ -439,4 +521,4 @@ export default {
   margin-top: 0.3125rem;
   margin-bottom: 1.25rem;
 }
-</style>
+</style>

+ 31 - 25
src/views/statisticalReport/app.js

@@ -1,50 +1,56 @@
 // The Vue build version to load with the `import` command
 // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
-import Vue from 'vue';
-import App from '@/components/App.vue';
+import Vue from "vue";
+import App from "@/components/App.vue";
 // include
-import '@/config/include.js';
+import "@/config/include.js";
 
 // 通用store
-import store from '@/store/index.js';
+import store from "@/store/index.js";
 
 // router
-import router from './router/index.js';
+import router from "./router/index.js";
 
-import VueApollo from 'vue-apollo'
-
-import apollo from '@/config/apolloConfig.js'
+import VueApollo from "vue-apollo";
 
+import apollo from "@/config/apolloConfig.js";
 
 // 注册表格的全局组件
 import DilCommonUI from "@/components/DilCommonUI";
 Vue.use(DilCommonUI);
 
 // 导出Excel全局组件
-import tableToExcel from '@/components/exportExcel/exportExcel'
-Vue.use(tableToExcel)
+import tableToExcel from "@/components/exportExcel/exportExcel";
+Vue.use(tableToExcel);
+
+import htmlToPdf from "@/components/exportPdfs/exportPdfs";
+Vue.use(htmlToPdf);
+//导出PDF组件
 
 // 关闭生产模式下给出的提示
 Vue.config.productionTip = false;
 
-Vue.use(VueApollo)
+Vue.use(VueApollo);
 
 const apolloProvider = new VueApollo({
-    defaultClient: apollo
-})
+  defaultClient: apollo
+});
 
- //把时间戳改为正常可读的时间
- export function renderTime(date) {
-  if(date !== null){
-      let dateee = new Date(date).toJSON();
-      return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, " ").replace(/\.[\d]{3}Z/, "");
+//把时间戳改为正常可读的时间
+export function renderTime(date) {
+  if (date !== null) {
+    let dateee = new Date(date).toJSON();
+    return new Date(+new Date(dateee) + 8 * 3600 * 1000)
+      .toISOString()
+      .replace(/T/g, " ")
+      .replace(/\.[\d]{3}Z/, "");
   }
   return null;
 }
 //把毫秒数转换分
 export function getDuration(my_time) {
-  if(my_time !== null){
-      return Math.floor(my_time / 1000 / 60);
+  if (my_time !== null) {
+    return Math.floor(my_time / 1000 / 60);
   }
   return null;
 }
@@ -55,11 +61,11 @@ export function sjTime(orderPlanInTime) {
 }
 //验证电话号码
 export function VerifyPhoneNumber(Phone) {
-  var myreg=/^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;
+  var myreg = /^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;
   if (!myreg.test(Phone)) {
-      return false;
+    return false;
   } else {
-      return true;
+    return true;
   }
 }
 export function isNumber(value) {
@@ -82,10 +88,10 @@ export function isIntegerNumber(value) {
 }
 /* eslint-disable no-new */
 new Vue({
-  el: '#app',
+  el: "#app",
   router,
   store,
   components: { App },
   provide: apolloProvider.provide(),
-  template: '<App/>'
+  template: "<App/>"
 });

+ 16 - 29
src/views/statisticalReport/components/Ship_dynamic_table.vue

@@ -13,16 +13,15 @@
         <el-button type="primary" class="btn" @click="onclick">
           <i class="el-icon-search"></i>查询
         </el-button>
-         <el-button type="primary" @click="gotoexcel()"
-          ><i class="el-icon-download"></i>导出(Excel)</el-button
-        >
+        <el-button type="primary" class="btn" @click="getPdfs()">
+          <i class="el-icon-upload2"></i>下载PDF
+        </el-button>
       </div>
-      <table-item :tableData="tableData" :col="col"> </table-item>
+      <table-item :tableData="tableData" :col="col" id="pdfDom"> </table-item>
     </div>
   </div>
 </template>
 <script>
-import LAY_EXCEL from "lay-excel";
 import tableItem from "./tableItem";
 export default {
   name: "TableView",
@@ -31,7 +30,7 @@ export default {
   },
   data() {
     return {
-      tableTitle: "船舶动态表",
+      htmlTitle: "船舶动态表",
       // 树型结构表头数据
       col: [
         {
@@ -142,8 +141,7 @@ export default {
       // 表格数据
 
       tableData: [],
-      input:"",
-
+      input: ""
     };
   },
   created() {},
@@ -152,28 +150,17 @@ export default {
     // console.log(this.$refs.excelDom);
   },
   methods: {
-    onclick(){
-        this.axios.post("/api/v1/tms/selectAllShipDynamaics?con=" + this.input).then((res) => {
-        if (res.data.code == "200") {
-          this.tableData = res.data.data;
-          console.log("aaad" +res.data.data);
-        } else if(res.data.data=="暂时没有船舶动态") { 
+    onclick() {
+      this.axios
+        .post("/api/v1/tms/selectAllShipDynamaics?con=" + this.input)
+        .then(res => {
+          if (res.data.code == "200") {
+            this.tableData = res.data.data;
+            console.log("aaad" + res.data.data);
+          } else if (res.data.data == "暂时没有船舶动态") {
             this.tableData = [];
-        }
-      });
-    },
-    gotoexcel() {
-      let _this = this;
-      let result = JSON.parse(JSON.stringify(_this.tableData));
-      console.log(result);
-      result.unshift({
-        pm: "品名",
-        portName: "港口名称",
-        tonnage: "下游港口吨位",
-        capacity1: "船名",
-        capacityNumber1: "吨位",
-        locationValue1: "位置",
-      });
+          }
+        });
     },
     initialization() {
       this.axios.post("/api/v1/tms/selectAllShipDynamaics").then(res => {

+ 1 - 0
src/views/statisticalReport/components/purchasFuelMonitor/purchasFuelNewMonitor.vue

@@ -6,6 +6,7 @@
         v-model="input"
         style="width:210px;display:flex;margin-right:90px;"
         placeholder="请输入条件查询"
+        clearable
       ></el-input>
       <span>计毛时间:</span>
       <el-date-picker

+ 61 - 32
src/views/statisticalReport/components/purchasFuelMonitor/purchasFuelOldMonitor.vue

@@ -2,7 +2,12 @@
 <template>
   <div class="purchasFuelOldMonitor">
     <div class="frameCalculation">
-      <el-input v-model="input" style="width:210px;display:flex;margin-right:90px;" placeholder="请输入条件查询"></el-input>
+      <el-input
+        v-model="input"
+        style="width:210px;display:flex;margin-right:90px;"
+        placeholder="请输入条件查询"
+        clearable
+      ></el-input>
       <span>计毛时间:</span>
       <el-date-picker
         v-model="startTime"
@@ -11,23 +16,29 @@
       >
       </el-date-picker>
       <span>至</span>
-      <el-date-picker
-        v-model="endTime"
-        type="datetime"
-        placeholder="选择日期"
-      >
+      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
       </el-date-picker>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-button type="primary" @click="exportData()"><i class="el-icon-download"></i>导出(Excel)</el-button>
+      <el-button type="primary" @click="exportData()"
+        ><i class="el-icon-download"></i>导出(Excel)</el-button
+      >
       <el-button type="primary" @click="refresh">
         <i class="el-icon-refresh"></i>刷新
       </el-button>
       <span style="margin-left: 1rem;">合计净重:</span>
-      <el-input v-model="totalNumber" :disabled="true" style="width: 150px;"></el-input>
+      <el-input
+        v-model="totalNumber"
+        :disabled="true"
+        style="width: 150px;"
+      ></el-input>
       <span style="margin-left: 1rem;">合计车数:</span>
-      <el-input v-model="totalCapacity" :disabled="true" style="width: 150px;"></el-input>
+      <el-input
+        v-model="totalCapacity"
+        :disabled="true"
+        style="width: 150px;"
+      ></el-input>
     </div>
     <div class="table">
       <dilTable ref="excelDom" v-bind.sync="option" @func="func"></dilTable>
@@ -36,13 +47,15 @@
 </template>
 
 <script>
-import { sjTime } from '@/utils/sharedJsFile'
+import { sjTime } from "@/utils/sharedJsFile";
 export default {
   data() {
     return {
-      input:null,
+      input: null,
       option: {
-        requestUrl: "/api/v1/tms/getRLFLReport?apiId=382&orderType=6&startTime=null&endTime=null&i=" +new Date(),
+        requestUrl:
+          "/api/v1/tms/getRLFLReport?apiId=382&orderType=6&startTime=null&endTime=null&i=" +
+          new Date()
       },
       startTime: null,
       endTime: null,
@@ -50,20 +63,20 @@ export default {
       totalNumber: 0,
       //合计车数
       totalCapacity: 0,
-      tableTitle:'采购燃料老区统计报表'
+      tableTitle: "采购燃料老区统计报表"
     };
   },
   methods: {
-    refresh(){
+    refresh() {
       this.$router.go(0);
     },
-    func(res){
-      console.log(res)
-      var resultNetWeightTotal = 0
+    func(res) {
+      console.log(res);
+      var resultNetWeightTotal = 0;
       res.list.forEach(e => {
-        resultNetWeightTotal = resultNetWeightTotal+e.resultNetWeight
+        resultNetWeightTotal = resultNetWeightTotal + e.resultNetWeight;
       });
-      this.totalNumber = resultNetWeightTotal.toFixed(2) + " t"
+      this.totalNumber = resultNetWeightTotal.toFixed(2) + " t";
       this.totalCapacity = res.total;
       //获取总记录条数作为合计车数
       // this.totalCapacity = res.total;
@@ -72,25 +85,41 @@ export default {
     onclick() {
       let startTime = null;
       let endTime = null;
-      if(this.startTime){
+      if (this.startTime) {
         startTime = sjTime(this.startTime);
       }
-      if(this.endTime){
+      if (this.endTime) {
         endTime = sjTime(this.endTime);
       }
-      if(startTime && endTime){
-        if(startTime < endTime){
-          this.option.requestUrl = "/api/v1/tms/getRLFLReport?apiId=382&orderType=6&startTime=" + startTime + "&endTime=" + endTime + "&con=" + this.input+ "&i=" +new Date();
-        }else{
+      if (startTime && endTime) {
+        if (startTime < endTime) {
+          this.option.requestUrl =
+            "/api/v1/tms/getRLFLReport?apiId=382&orderType=6&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
+            "&con=" +
+            this.input +
+            "&i=" +
+            new Date();
+        } else {
           this.startTime = null;
           this.endTime = null;
-          this.$message.warning('开始时间要比结束时间早')
+          this.$message.warning("开始时间要比结束时间早");
         }
-      }else{
-        this.option.requestUrl = "/api/v1/tms/getRLFLReport?apiId=382&orderType=6&startTime=" + startTime + "&endTime=" +  "&con=" + this.input + endTime + "&i=" +new Date();
+      } else {
+        this.option.requestUrl =
+          "/api/v1/tms/getRLFLReport?apiId=382&orderType=6&startTime=" +
+          startTime +
+          "&con=" +
+          this.input +
+          "&endTime=" +
+          endTime +
+          "&i=" +
+          new Date();
       }
-    },
-  },
+    }
+  }
 };
 </script>
 
@@ -102,9 +131,9 @@ export default {
     display: flex;
     align-items: center;
     padding-left: 50px;
-    .el-date-editor{
+    .el-date-editor {
       margin: 20px;
     }
   }
 }
-</style>
+</style>

+ 1 - 1
src/views/statisticalReport/components/salesLogisticsStatistics/saleChemicalCokeForm.vue

@@ -31,7 +31,7 @@
           <el-input
             v-model="inputMaterial"
             style="width:200px"
-            placeholder="输入物资名称或备注"
+            placeholder="输入仓库或物资名称或备注"
             clearable="true"
           ></el-input>
         </el-form-item>