소스 검색

Merge remote-tracking branch 'origin/dev' into dev

lichao 3 년 전
부모
커밋
14937b58d4

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 886 - 11
package-lock.json


+ 2 - 0
package.json

@@ -22,6 +22,7 @@
     "js-base64": "^2.5.1",
     "js-cookie": "^2.2.0",
     "js-md5": "^0.7.3",
+    "less-loader": "^10.2.0",
     "lodash": "^4.17.21",
     "mockjs": "^1.0.1-beta3",
     "node-gyp": "^5.0.6",
@@ -41,6 +42,7 @@
     "@vue/cli-plugin-eslint": "^3.1.5",
     "@vue/cli-service": "^3.1.4",
     "chai": "^4.1.2",
+    "image-webpack-loader": "^8.1.0",
     "node-sass": "^4.12.0",
     "sass-loader": "^7.0.1",
     "vue-template-compiler": "^2.5.17",

+ 3 - 1
public/index.html

@@ -21,7 +21,9 @@
   <script src="<%= BASE_URL %>cdn/xlsx/xlsx.full.min.js"></script>
 <!--    导入拖拽-->
   <script src="https://cdn.staticfile.org/Sortable/1.10.0-rc2/Sortable.min.js"></script>
-<!--  <link rel="icon" href="<%= BASE_URL %>favicon.png">-->
+<!--    导入高德地图-->
+  <script src="https://webapi.amap.com/maps?v=1.4.15&key=9fe905e45ed0e2cfbf69479b4cd83edf"></script>
+    <!--  <link rel="icon" href="<%= BASE_URL %>favicon.png">-->
   <link rel="icon" href="<%= BASE_URL %>tubaoFavicon.ico">
   <title>途宝企业级开发平台</title>
   <style>

+ 9 - 0
src/api/gaude.js

@@ -0,0 +1,9 @@
+import request from '@/router/axios';
+
+export const gaude = (params) => {
+    return request({
+        url: '/api/blade-land/order-track/location-list',
+        method: 'get',
+        params: params
+    })
+}

+ 18 - 0
src/api/landTransportation/antiepidemic.js

@@ -0,0 +1,18 @@
+import request from '@/router/axios';
+
+// 列表查询
+export function driverQueryCollection(data) {
+    return request({
+        url: '/api/blade-land/ncp-check/list',
+        method: 'get',
+        params:data
+    })
+}
+//获取附件
+export function getAttachment(data) {
+    return request({
+        url: '/api/blade-land/ncp-check/file-list',
+        method: 'get',
+        params:data
+    })
+}

+ 4 - 0
src/enums/column-name.js

@@ -467,6 +467,10 @@ const columnName = [{
   {
     code: 124,
     name: '交接单附件上传'
+  },
+  {
+    code: 125,
+    name: '防疫'
   }
 ]
 export const getColumnName = (key) => {

+ 365 - 0
src/views/landTransportation/antiepidemic/index.vue

@@ -0,0 +1,365 @@
+<template>
+  <div>
+    <basic-container v-if="key>0">
+      <avue-crud
+          :data="goodsList"
+          :option="goodsOptionCrud"
+          :table-loading="loading"
+          :page.sync="page"
+          ref="crud"
+          @on-load="onLoad"
+          @resetColumn="resetColumn"
+          @saveColumn="saveColumn"
+          @search-change="searchChange"
+          @search-criteria-switch="searchCriteriaSwitch">
+        <template slot-scope="{row,index}" slot="menu">
+          <el-button
+              size="small"
+              type="text"
+              @click="annexOpen(row, index)"
+          >附 件
+          </el-button>
+        </template>
+      </avue-crud>
+      <el-dialog
+          title="附件"
+          :visible.sync="dialogVisible"
+          append-to-body
+          width="80%">
+<!--        <c-upload-->
+<!--            typeUpload="GZ"-->
+<!--            :basic="true"-->
+<!--            deleteUrl="/api/blade-client/common-file/remove"-->
+<!--            :data="orderList"-->
+<!--            :disabled="true"-->
+<!--            :enumerationValue="76"-->
+<!--        ></c-upload>-->
+        <el-upload
+            class="hide"
+            list-type="picture-card"
+            :on-preview="handlePictureCardPreview"
+            :file-list="orderList"
+            disabled>
+          <i class="el-icon-plus"></i>
+        </el-upload>
+        <el-dialog :visible.sync="visible" append-to-body>
+          <img width="100%" :src="dialogImageUrl" alt="">
+        </el-dialog>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogVisible = false" size="small">取 消</el-button>
+<!--          <el-button type="primary" @click="saveAnnex" size="small" :disabled="form.status===4">保 存</el-button>-->
+        </span>
+      </el-dialog>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import {
+  driverQueryCollection,
+  getAttachment
+} from "@/api/landTransportation/antiepidemic";
+
+export default {
+  name: "index",
+  data() {
+    return {
+      visible:false,
+      dialogImageUrl:'',
+      key:0,
+      form: {},
+      orderList:[],
+      dialogVisible: false,
+      loading: false,
+      activeName:'',
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 50, 100, 200, 300]
+      },
+      roleName: localStorage.getItem("roleName").split(',')[0],
+      goodsList: [],
+      goodsOptionCrud:{},
+      optionList: {
+        stripe:true,
+        index: true,
+        addBtn: false,
+        delBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        editBtn: false,
+        addRowBtn: false,
+        searchIcon: true,
+        searchIndex: 2,
+        searchSpan: 8,
+        searchMenuPosition: "right",
+        searchMenuSpan: 6,
+        align: 'center',
+        height: "auto",
+        column: [{
+          label: '车牌号',
+          prop: 'plateNo',
+          overHidden: true,
+          index: 1,
+          width: 150,
+          search: true,
+        },{
+          label: '电话',
+          prop: 'tel',
+          overHidden: true,
+          index: 2,
+          width: 200,
+          search: true,
+        },{
+          label: '制单日期',
+          prop: 'createTime',
+          overHidden: true,
+          index: 3,
+          width: 150
+        }
+        ],
+      },
+    }
+  },
+  async created() {
+    this.goodsOptionCrud = await this.getColumnData(this.getColumnName(125), this.optionList);
+    this.key++
+    let i = 0;
+    this.goodsOptionCrud.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.goodsOptionCrud.searchMenuSpan = num * 8;
+      this.goodsOptionCrud.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    handlePictureCardPreview(file) {
+      this.dialogImageUrl = file.url;
+      this.visible = true;
+    },
+    //自定义列保存
+    async saveColumn() {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(125), this.goodsOptionCrud);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumn() {
+      this.goodsOptionCrud = this.optionList;
+      const inSave = await this.delColumnData(this.getColumnName(125), this.optionList);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 获得高度
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.goodsOptionCrud.height = this.goodsOptionCrud.height - 230
+      } else {
+        this.goodsOptionCrud.height = this.goodsOptionCrud.height + 230
+      }
+      this.$refs.crud.getTableHeight()
+    },
+    //打开附件
+    annexOpen(row, index){
+      this.orderList = []
+      this.form = row
+      getAttachment({id:row.id}).then(res=>{
+        this.orderList = res.data.data
+        this.dialogVisible = true
+      })
+    },
+    //搜索
+    searchChange(params, done) {
+      let data = params
+      if (params.arrivalTime) {
+        data.beginArrivalTime = params.arrivalTime[0]
+        data.endArrivalTime = params.arrivalTime[1]
+      }
+      if (params.createTime) {
+        data.beginCrateTime = params.createTime[0]
+        data.endCrateTime = params.createTime[1]
+      }
+      delete data.arrivalTime
+      delete data.createTime
+      this.onLoad(this.page, params)
+      done();
+    },
+    //查询
+    onLoad(page, params) {
+      let queryParams = {
+        size: page.pageSize,
+        current: page.currentPage,
+        ...params
+      }
+      this.loading = true;
+      driverQueryCollection(queryParams).then(res => {
+        this.goodsList = res.data.data.records
+        this.page.total = res.data.data.total
+        this.goodsOptionCrud.height = window.innerHeight - 250;
+      }).finally(() => {
+        this.loading = false;
+      })
+    },
+    ToBreak (val) {
+      if (val)return val.replace(/\n/g, '<br/>')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .hide .el-upload--picture-card {
+  display: none;
+}
+.home-container {
+  padding: 0px 5px 5px 5px;
+  box-sizing: border-box;
+  height: 100%;
+
+  ::v-deep .el-card__body {
+    padding: 10px 15px;
+    font-size: 14px;
+  }
+
+  &__card {
+    width: 100%;
+    height: 100%;
+  }
+
+  .title {
+    display: flex;
+    justify-content: space-between;
+
+    .right {
+      display: flex;
+      align-items: center;
+
+      &_but {
+        margin-right: 10px;
+        border: 1px solid #409eff;
+        width: 80px;
+        border-radius: 3px;
+        display: flex;
+
+        &_left {
+          width: 40px;
+          text-align: center;
+          color: #409eff;
+          cursor: pointer;
+        }
+
+        &_right {
+          width: 40px;
+          text-align: center;
+          color: #409eff;
+          cursor: pointer;
+        }
+
+        &_active {
+          color: #fff;
+          background-color: #409eff;
+        }
+      }
+    }
+  }
+}
+
+.content {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 6vh;
+  width: 80vw;
+
+  .divider {
+    display: block;
+    height: 0px;
+    width: 100%;
+    border-top: 1px dashed #dcdfe6;
+  }
+
+  &-item {
+    margin-left: 1vw;
+
+    .card {
+      width: 130px;
+      display: flex;
+      align-items: center;
+
+      &-title {
+        width: 40px;
+        height: 40px;
+        text-align: center;
+        border-radius: 50%;
+        font-size: 20px;
+        font-weight: 600;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+
+        span {
+          line-height: 20px;
+        }
+      }
+
+      &-title1 {
+        color: #037fe1;
+        background-color: rgba(3, 127, 225, 0.15);
+      }
+
+      &-title2 {
+        color: #ffa21e;
+        background-color: rgba(255, 162, 30, 0.15);
+      }
+
+      &-title3 {
+        color: #fb5b60;
+        background-color: rgba(251, 91, 96, 0.15);
+      }
+
+      &-title4 {
+        color: #42bc6f;
+        background-color: rgba(66, 1125, 111, 0.15);
+      }
+
+      &-title5 {
+        color: #14cde1;
+        background-color: rgba(52, 149, 161, 0.15);
+      }
+
+      &-title6 {
+        color: rgba(4, 66, 31, 0.63);
+        background-color: rgba(66, 1125, 111, 0.15);
+      }
+
+      &-content {
+        padding-left: 1vw;
+        display: flex;
+        flex-direction: column;
+
+        &-num {
+          font-size: 20px;
+          font-weight: 600;
+        }
+
+        &-text {
+          color: #909399;
+        }
+      }
+    }
+  }
+}
+</style>

+ 1 - 2
src/views/wel/home/landTransportation/components/audit-data.vue

@@ -53,14 +53,13 @@ export default {
     };
   },
   created() {
-    this.getSysType();
+    this.getCheckDate();
   },
   methods: {
     getCheckDate() {
       this.loading = true;
       count({ tradeType: this.tradeType })
         .then(res => {
-          console.log(res.data.data)
           this.list.forEach(e => {
             if(e.text == "今日新增柜数")e.qty = res.data.data.newly
             if(e.text == "未安排柜数")e.qty = res.data.data.inactive

+ 133 - 15
src/views/wel/home/landTransportation/components/sales-trend.vue

@@ -8,9 +8,9 @@
           </span>
           <span>
             <i
-              class="el-icon-refresh-right"
-              style="cursor: pointer;font-size:20px"
-              @click="refresh"
+                class="el-icon-refresh-right"
+                style="cursor: pointer;font-size:20px"
+                @click="refresh"
             ></i>
           </span>
         </div>
@@ -22,20 +22,24 @@
               height="420"
               style="width: 100%;">
             <el-table-column
+                align="center"
                 prop="billNo">
               <template slot-scope="{row}">
-                <span class="el-button--text" style="cursor: pointer" @click="dialogVisible = true">{{row.billNo}}</span>
+                <span class="el-button--text" style="cursor: pointer"
+                      @click="openTrack(row)">{{ row.billNo }}</span>
               </template>
             </el-table-column>
             <el-table-column
-                width="90"
+                width="120"
+                align="center"
                 prop="plateNo">
               <template slot-scope="{row}">
-                <span class="el-button--text" style="cursor: pointer" @click="dialogVisible = true">{{row.plateNo}}</span>
+                <span class="el-button--text" style="cursor: pointer"
+                      @click="openTrack(row)">{{ row.plateNo }}</span>
               </template>
             </el-table-column>
             <el-table-column
-                width="80"
+                width="100"
                 prop="status">
               <template slot-scope="{row}">
                 <span v-if="row.status == 0" style="color: #E45656;">未调度</span>
@@ -59,14 +63,30 @@
         title="车辆轨迹"
         append-to-body
         :visible.sync="dialogVisible"
+        fullscreen
         width="80%">
-      <img style="width: 100%" src="https://trade.tubaosoft.com/file/bladex/000000/1123598821738675201/222E5F45-10AF-42A6-A47E-628E1053EFAF.png" alt="">
+      <div id="container"></div>
+      <div class="input-card" v-if="this.lineArr.length>0">
+        <h4>轨迹回放控制</h4>
+        <div class="input-item">
+          <input type="button" class="btn" value="开始动画" id="start" @click="startAnimation()"/>
+          <input type="button" class="btn" value="暂停动画" id="pause" @click="pauseAnimation()"/>
+        </div>
+        <div class="input-item">
+          <input type="button" class="btn" value="继续动画" id="resume" @click="resumeAnimation()"/>
+          <input type="button" class="btn" value="停止动画" id="stop" @click="stopAnimation()"/>
+        </div>
+      </div>
+      <div class="input-card" v-else>
+        <span style="color: red">暂无该车辆轨迹信息</span>
+      </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import { active } from "@/api/wel";
+import {active} from "@/api/wel";
+import {gaude} from "@/api/gaude";
 export default {
   name: "basicContainer",
   props: {
@@ -74,21 +94,96 @@ export default {
   },
   data() {
     return {
-      dialogVisible:false,
+      dialogVisible: false,
       loading: false,
-      tableData:[]
+      tableData: [],
+      map: null,
+      marker: null,
+      lineArr: []
     };
   },
   mounted() {
     this.init();
   },
+  beforeDestroy() {
+    this.map && this.map.destroy();
+  },
   methods: {
+    openTrack(row){
+      this.dialogVisible = true
+      gaude({itemId: row.id}).then(res => {
+        console.log(res.data.data)
+        this.lineArr = res.data.data
+        this.initMap();
+      })
+    },
+    initMap() {
+      this.map = new AMap.Map("container", {
+        resizeEnable: true,
+        center: [116.397428, 39.90923],
+        zoom: 17
+      });
+
+      let icon = new AMap.Icon({
+        size: new AMap.Size(52, 26), // 图标尺寸
+        image: 'https://webapi.amap.com/images/car.png',
+        imageSize: new AMap.Size(52, 26), // 根据所设置的大小拉伸或压缩图片
+      });
+      this.marker = new AMap.Marker({
+        map: this.map,
+        position: this.lineArr.length >0 ?this.lineArr[this.lineArr.length - 1]:[120.382891,36.066460],
+        // icon: "https://webapi.amap.com/images/car.png",
+        icon: icon,
+        markerMeta: new AMap.Size(28, 28),
+        offset: new AMap.Pixel(-26, -15),
+        autoRotation: true,
+        angle: -15
+      });
+
+      // 绘制轨迹
+      let polyline = new AMap.Polyline({
+        map: this.map,
+        path: this.lineArr,
+        showDir: true,
+        strokeColor: "#28F", //线颜色
+        // strokeOpacity: 1,     //线透明度
+        strokeWeight: 6 //线宽
+        // strokeStyle: "solid"  //线样式
+      });
+
+      let passedPolyline = new AMap.Polyline({
+        map: this.map,
+        // path: this.lineArr,
+        strokeColor: "#AF5", //线颜色
+        // strokeOpacity: 1,     //线透明度
+        strokeWeight: 6 //线宽
+        // strokeStyle: "solid"  //线样式
+      });
+
+      this.marker.on("moving", function (e) {
+        passedPolyline.setPath(e.passedPath);
+      });
+
+      this.map.setFitView();
+    },
+    startAnimation() {
+      this.marker.moveAlong(this.lineArr, 100000);
+    },
+    pauseAnimation() {
+      this.marker.pauseMove();
+    },
+    resumeAnimation() {
+      this.marker.resumeMove();
+    },
+    stopAnimation() {
+      this.marker.stopMove();
+    },
     init() {
       this.getsalesTrend();
     },
     getsalesTrend() {
       this.loading = true;
-      active().then(res=>{
+      active().then(res => {
         this.tableData = res.data.data
         this.tableData = this.tableData.concat(res.data.data)
         this.tableData = this.tableData.concat(res.data.data)
@@ -107,31 +202,54 @@ export default {
 };
 </script>
 
+<style scoped xml:lang="less">
+@import url('https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css');
+
+#container {
+  height: 93vh;
+  width: 100%;
+}
+
+.input-card .btn {
+  margin-right: 1.2rem;
+  width: 9rem;
+}
+
+.input-card .btn:last-child {
+  margin-right: 0;
+}
+</style>
+
 <style lang="scss" scoped>
 .home-container {
   padding: 0px 5px 5px 0px;
   box-sizing: border-box;
   height: 100%;
+
   ::v-deep .el-card__body {
     padding: 10px 15px;
     font-size: 14px;
   }
+
   &__card {
     width: 100%;
     height: 100%;
   }
+
   .title {
     display: flex;
     justify-content: space-between;
   }
 }
+
 .content {
 }
 
-::v-deep .el-dialog{
-  margin-top: 10vh !important;
+::v-deep .el-dialog {
+  margin-top: 0vh !important;
 }
-::v-deep .el-dialog__body{
+
+::v-deep .el-dialog__body {
   padding: 0 20px 10px 20px !important;
 }
 </style>

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.