luobang 3 years ago
parent
commit
87d8dfa49f

+ 1 - 1
build/utils.js

@@ -17,7 +17,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
 // let devModules = ['index','statisticalReport','appoint']
 // let devModules = ['index','appoint','sale','RMS','statisticalReport'];
-// let devModules = ['index','appoint','WMS'];
+//let devModules = ['index','appoint','WMS'];
 // let devModules = ['index','inward']
 let devModules = ['all']
 // let devModules = ['index','sale']

+ 3 - 2
config/index.js

@@ -64,8 +64,9 @@ let proxyTable = {
   },
   // 所有数据的请求域名地址
   "/api/v1": {
+    // target: "http://192.168.1.101:8019",
     target: "http://172.16.33.166:8080",
-    // target: "http://192.168.1.112:8080",
+    // target: "http://192.168.1.114:8019",
     ws: true,
     pathRewrite: {
       "^/api/v1": "/api/v1"
@@ -73,7 +74,7 @@ let proxyTable = {
   },
   "/views/api/v1": {
     target: "http://172.16.33.166:8080",
-    // target: "http://192.168.1.112:8080",
+    // target: "http://192.168.1.101:8019",
     ws: true,
     pathRewrite: {
       "^/views/api/v1": "/api/v1"

+ 35 - 22
src/views/appoint/components/saleContract/saleOrderSteel.vue

@@ -15,13 +15,16 @@
       <el-button type="primary" @click="batchReport">
         <i class="upload2"></i>批量上传
       </el-button>
+      <el-button type="primary" @click="exportData()"
+        ><i class="el-icon-download"></i>导出(Excel)</el-button
+      >
     </div>
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <!-- 未上报 -->
       <el-tab-pane label="未上报" name="first">
         <mergeRowTable
           v-bind.sync="option"
-          ref="table3"
+          ref="excelDom"
           @selection-change="selectionChange"
         >
           <el-table-column
@@ -73,6 +76,7 @@ export default {
     return {
       batchReportList: [],
       activeName: "first",
+      tableTitle: "未上传销售订单报表",
       drawer: false,
       input: "",
       index: "",
@@ -82,19 +86,26 @@ export default {
         // 表格请求数据的地址
         requestUrl: "/api/v1/ams/getSaleOrderInfoes?apiId=408",
         selectionType: "select",
+<<<<<<< HEAD
         comparison: "saleNumber",
         columnIndexs: [0, 1, 2, 3, 4, 8, 9, 10, 11, 12, 13, 14, 15]
+=======
+>>>>>>> f2150ab3172b86585a09574acc2db8baa1c3db03
       },
       option2: {
         // 表格请求数据的地址
         requestUrl: "/api/v1/ams/getSaleOrderReportedes?apiId=408",
+<<<<<<< HEAD
         comparison: "saleNumber",
         columnIndexs: [0, 1, 2, 3, 7, 8, 9, 10, 11, 12, 13, 14, 15]
+=======
+>>>>>>> f2150ab3172b86585a09574acc2db8baa1c3db03
       },
       option4: {
         // 表格请求数据的地址
         requestUrl:
           "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409&shipperId=1&saleType=1",
+<<<<<<< HEAD
         comparison: "saleNumber",
         columnIndexs: [
           0,
@@ -115,6 +126,8 @@ export default {
           18,
           20
         ]
+=======
+>>>>>>> f2150ab3172b86585a09574acc2db8baa1c3db03
       },
       mapList: [],
       mapItemList: [],
@@ -138,23 +151,23 @@ 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: [],
@@ -163,7 +176,7 @@ export default {
       //(已上报)
       tableData2: [],
       //(未上报)
-      tableData3: []
+      tableData3: [],
     };
   },
   created() {
@@ -230,7 +243,7 @@ export default {
       }
       this.axios
         .post("/api/v1/ams/uploadSaleOrderList", this.batchReportList)
-        .then(res => {
+        .then((res) => {
           if (res.data.code == "200") {
             this.$message.success("上传成功");
             this.getRequestUrl();
@@ -335,7 +348,7 @@ export default {
       // 根据销售订单id查询物资信息
       this.axios
         .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" + row.saleOrderId)
-        .then(res => {
+        .then((res) => {
           this.tableData = res.data.data;
         });
     },
@@ -366,7 +379,7 @@ export default {
       // 根据销售订单id查询物资信息
       this.axios
         .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" + row.saleOrderId)
-        .then(res => {
+        .then((res) => {
           this.tableData1 = res.data.data;
         });
     },
@@ -397,7 +410,7 @@ export default {
       // 根据销售订单id查询物资信息
       this.axios
         .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" + row.saleOrderId)
-        .then(res => {
+        .then((res) => {
           this.tableData2 = res.data.data;
         });
     },
@@ -409,12 +422,12 @@ export default {
         this.oldRowCount3 += 1;
       }
       // 切换当前详情表
-      this.$refs.table3.toggleRowExpansion(row);
+      this.$refs.excelDom.toggleRowExpansion(row);
       // 打开前关闭上一个详情表
       if (this.oldRow3 != "") {
         if (this.oldRow3 != row) {
           if (this.oldRowCount3 % 2 === 1) {
-            this.$refs.table3.toggleRowExpansion(this.oldRow3);
+            this.$refs.excelDom.toggleRowExpansion(this.oldRow3);
           } else {
             this.oldRowCount3 = 1;
           }
@@ -428,7 +441,7 @@ export default {
       // 根据销售订单id查询物资信息
       this.axios
         .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" + row.saleOrderId)
-        .then(res => {
+        .then((res) => {
           this.tableData3 = res.data.data;
         });
     },
@@ -439,12 +452,12 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-        center: true
+        center: true,
       })
         .then(() => {
           this.axios
             .post("/api/v1/ams/uploadSaleOrder?saleOrderId=" + saleOrderId)
-            .then(res => {
+            .then((res) => {
               if (res.data.code == "200") {
                 this.$message.success("上传成功!");
                 this.getRequestUrl();
@@ -457,7 +470,7 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "取消上传!"
+            message: "取消上传!",
           });
         });
     },
@@ -468,7 +481,7 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-        center: true
+        center: true,
       })
         .then(() => {
           this.axios
@@ -476,7 +489,7 @@ export default {
               "/api/v1/ams/deleteAmsSaleOrderBySaleOrderId?saleOrderId=" +
                 saleOrderId
             )
-            .then(res => {
+            .then((res) => {
               if (res.data.code == "200") {
                 this.$message.success("删除成功");
                 this.getRequestUrl();
@@ -489,11 +502,11 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "取消删除!"
+            message: "取消删除!",
           });
         });
-    }
-  }
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 10 - 4
src/views/sale/components/offSiteTransportation/checkGPS.vue

@@ -382,10 +382,16 @@ export default {
     //校验查询时间
     changeTime() {
       let that = this;
+      console.log("that.time")
+      console.log(that.time)
+     
       if(that.time!=null&&that.time.length==2){
-        if (that.time[1] - that.time[0] > 86400000 * 3) {
+        if (that.time[1].getTime() - that.time[0].getTime() > 86400000 * 3) {
           this.$message.error("时间查询范围不能超过3天");
           that.time = [];
+        }else if(that.time[1].getTime()<that.time[0].getTime()){
+           this.$message.error("开始时间要大于结束时间");
+            that.time = [];
         }
       } 
     },
@@ -484,21 +490,21 @@ export default {
         .then(res => {
           if (res.data.startAndEndRoutes != "") {
             that.listPath = res.data.startAndEndRoutes;
-            that.initMap();
+            that.initMap([105.602725, 37.076636]);
           } else {
             this.$message.error("车辆没有开启GPS");
           }
         });
     },
     //初始化地图
-    initMap() {
+    initMap(lonlat) {
       lazyAMapApiLoaderInstance.load().then(() => {
         let that = this;
         that.map = new AMap.Map("amap-container", {
           //设置地图容器id
           viewMode: "2D", //是否为2D地图模式
           zoom: 10, //初始化地图级别
-          center: [105.602725, 37.076636] //初始化地图中心点位置
+          center: lonlat, //初始化地图中心点位置
         });
         //初始化
         that.initGeocoder();

+ 241 - 0
src/views/sale/components/offSiteTransportation/currentLocation.vue

@@ -0,0 +1,241 @@
+<template>
+  <div class="container">
+    <div id="amap-container"></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">查询</el-button>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { shallowRef } from "@vue/reactivity";
+import { lazyAMapApiLoaderInstance } from "vue-amap";
+import { sjTime, stringToDate } from "@/utils/sharedJsFile";
+import Slider from "./slider.vue";
+Vue.use(Slider);
+import Vue from "vue";
+export default {
+  name: "PathView",
+  setup() {
+    const map = shallowRef(null);
+    return {
+      map
+    };
+  },
+  watch: {
+    speedVal: {
+      deep: true,
+      handler(val, oldVal) {
+        let that = this;
+        if (that.pathNavigator != null) {
+          that.pathNavigator.setSpeed(100 * val);
+        }
+      }
+    }
+  },
+  data() {
+    return {
+     
+      //查询车牌号
+      carNumber: "",
+      //地图组件
+      map:null,
+
+    };
+  },
+  created() {
+    let that =this;
+    that.initMap(105.602725,37.076636)
+  },
+  mounted() {},
+  methods: {
+    
+
+    //初始化数据
+    initData() {
+      let that = this;
+      if (that.carNumber == "") {
+        this.$message.error("车牌号不能为空!");
+        return;
+      }
+      that.axios
+        .get("/api/v1/otms/getCurrentLocation?capcityNumber="+that.carNumber)
+        .then(res => {
+          console.log(res);
+          console.log(res.data.data.result.lon);
+          console.log(res.data.data.result.lat);
+          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,"现在所在位置");
+          //显示窗体
+          that.initCustomMarkes(that.carNumber,res.data.data.result.adr,res.data.data.result.lon,res.data.data.result.lat);
+          });
+          
+    },
+   
+   
+    //初始化地图
+    initMap(lon,lat) {
+      lazyAMapApiLoaderInstance.load().then(() => {
+        let that = this;
+        that.map = new AMap.Map("amap-container", {
+          //设置地图容器id
+          viewMode: "2D", //是否为2D地图模式
+          zoom: 10, //初始化地图级别
+          center: [lon,lat] //初始化地图中心点位置105.602725,37.076636
+        });
+      });
+    },
+
+     //创建简单的标记
+    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(2, 10), // 图像相对展示区域的偏移量,适于雪碧图等
+        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);
+    },
+   
+    //初始化窗体
+    initCustomMarkes(title, details, lon, lat) {
+      let that = this;
+      //自定义窗体内容
+      var content = [
+        "<div  style='top:1px;width: 180px; background-color: rgba(0, 0, 0, 1);' ><font color='white'>" +
+          title +
+          "</font>",
+        "<div style='background-color:rgba(255, 255, 255, 0.5);'><font color='white'>" +
+          details +
+          "</font></div></div>"
+      ];
+      // 创建 infoWindow 实例
+      var infoWindow = new AMap.InfoWindow({
+        content: content.join("<br>"),//传入 dom 对象,或者 html 字符串
+        offset:new AMap.Pixel(0,-20)//修改信息差窗体偏移
+      });
+      // 打开信息窗体
+      infoWindow.open(that.map, [lon, lat]);
+    },
+  
+  }
+};
+</script>
+<style>
+.inputStyle {
+  position: absolute;
+  width: 200px;
+  left: 50px;
+}
+
+.controller {
+  width: 100%;
+  height: 70px;
+  background: white;
+  position: absolute;
+  z-index: 99;
+  top: 0;
+  left: 0;
+}
+.in_transit_information {
+  width: 320px;
+  float: left;
+  height: 40px;
+}
+
+.container {
+  width: 100%;
+  height: 100%;
+}
+span.item_details2 {
+  position: relative;
+  top: 20px;
+}
+.date_picker_style {
+  position: relative;
+  left: 50px;
+}
+.item_details {
+  position: relative;
+  top: 5px;
+  height: 0px;
+  left: 0px;
+}
+#amap-container {
+  position: relative;
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  margin: 0;
+  font-family: "微软雅黑";
+}
+
+/* 进度条 */
+.mySlider {
+  width: 150px;
+  height: 20px;
+  display: inline-block;
+  position: relative;
+  left: 32px;
+}
+/* 进度条 */
+.mySlider2 {
+  width: 400px;
+  height: 20px;
+  display: inline-block;
+  position: relative;
+  left: 32px;
+}
+.play {
+  position: relative;
+  left: 28px;
+}
+.quickly {
+  float: right;
+  position: relative;
+  left: -20px;
+  top: 10px;
+}
+.pause {
+  position: relative;
+  left: 28px;
+}
+.passed-time {
+  position: relative;
+  left: 5px;
+}
+.end-time {
+  position: relative;
+  left: 5px;
+}
+.map-times {
+  position: relative;
+  width: 40px;
+}
+.searchstyle {
+  position: relative;
+  left: 45px;
+}
+.map-control {
+  float: left;
+  width: 270px;
+}
+.driving_information {
+  height: 40px;
+  width: 240px;
+  float: left;
+}
+</style>

+ 2 - 0
src/views/sale/router/index.js

@@ -103,6 +103,7 @@ import getBmsTruckStatementOrder from '../components/transportFreight/saleTruckS
 import getTransportResult from '../components/transportFreight/saleTruckSettlement/getTransportResult.vue'
 import mapTest from '../components/offSiteTransportation/mapTest.vue'
 import checkGPS from '../components/offSiteTransportation/checkGPS.vue'
+import currentLocation from '../components/offSiteTransportation/currentLocation.vue'
 import inTransit from '../components/offSiteTransportation/inTransit.vue'  
 import inTransitWarn from '../components/offSiteTransportation/inTransitWarn.vue'
 //测试数据
@@ -214,6 +215,7 @@ const constantRouterMap = [
 		{path: 'getTransportResult/:orderId', name: 'getTransportResult', meta: {code: 'xtpzgl-yhgl'}, component: getTransportResult},
 		{path: 'mapTest', name: 'mapTest', meta: {code: 'xtpzgl-yhgl'}, component: mapTest},  
 		{path: 'checkGPS', name: 'checkGPS', meta: {code: 'xtpzgl-yhgl'}, component: checkGPS},
+		{path: 'currentLocation', name: 'currentLocation', meta: {code: 'xtpzgl-yhgl'}, component: currentLocation},
 		{path: 'inTransitWarn', name: 'inTransitWarn', meta: {code: 'xtpzgl-yhgl'}, component: inTransitWarn},
 	  ]
 	}