AaronBruin 3 months ago
parent
commit
809b9d72bc
39 changed files with 922 additions and 1423 deletions
  1. 8 0
      .env.development
  2. 5 0
      .env.production
  3. 27 0
      package-lock.json
  4. 1 0
      package.json
  5. 8 0
      src/api/freezer.js
  6. 16 0
      src/api/refrigerator.js
  7. BIN
      src/assets/images/truck.png
  8. BIN
      src/assets/vehicle/0070ff.png
  9. BIN
      src/assets/vehicle/00fdff.png
  10. BIN
      src/assets/vehicle/17abe3.png
  11. BIN
      src/assets/vehicle/67C23A.png
  12. BIN
      src/assets/vehicle/9f00ff.png
  13. BIN
      src/assets/vehicle/E6A23C.png
  14. BIN
      src/assets/vehicle/a4579d.png
  15. BIN
      src/assets/vehicle/d4237a.png
  16. BIN
      src/assets/vehicle/f9ff00.png
  17. BIN
      src/assets/vehicle/ff0000.png
  18. 0 1285
      src/components/centerControl.vue
  19. 8 3
      src/components/forms.vue
  20. 9 3
      src/components/tables.vue
  21. 1 1
      src/components/treeTable.vue
  22. 56 0
      src/config/iceManagement.js
  23. 10 3
      src/router/generator-routers.js
  24. 1 0
      src/store/modules/user.js
  25. 2 1
      src/utils/request.js
  26. 94 2
      src/views/IceCreamFreezer/FreezerManagement.vue
  27. 134 9
      src/views/IceCreamFreezer/IceManagement.vue
  28. 116 10
      src/views/IceCreamFreezer/freezer.js
  29. 10 2
      src/views/IceCreamFreezer/iceRaft.js
  30. 46 2
      src/views/IceCreamFreezer/refrigerator.js
  31. 11 2
      src/views/common/topNav.vue
  32. 108 14
      src/views/incubator/IncubatorManagement.vue
  33. 36 5
      src/views/incubator/incubator.js
  34. 17 5
      src/views/incubator/retrospect.js
  35. 129 45
      src/views/page/incubatorView.vue
  36. 14 1
      src/views/system/CompanyManagement.vue
  37. 41 29
      src/views/system/company.js
  38. 2 1
      vue.config.js
  39. 12 0
      yarn.lock

+ 8 - 0
.env.development

@@ -0,0 +1,8 @@
+# just a flag
+ENV = 'development'
+
+# base api
+#VUE_APP_BASE_API = 'https://colddelivery.coldbaozhida.com/cold_delivery'
+VUE_APP_BASE_API = 'https://colddelivery.coldbaozhida.com/cold_delivery'
+
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 5 - 0
.env.production

@@ -0,0 +1,5 @@
+# just a flag
+ENV = 'production'
+
+# base api
+VUE_APP_BASE_API = 'https://colddelivery.coldbaozhida.com/cold_delivery'

+ 27 - 0
package-lock.json

@@ -22,6 +22,7 @@
         "vue-amap": "^0.5.10",
         "vue-buffer": "^0.0.1",
         "vue-router": "^3.5.1",
+        "vue-seamless-scroll": "^1.1.23",
         "vuex": "^3.6.2"
       },
       "devDependencies": {
@@ -4880,6 +4881,11 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/comutils": {
+      "version": "1.1.19",
+      "resolved": "https://registry.npmmirror.com/comutils/-/comutils-1.1.19.tgz",
+      "integrity": "sha512-JxXB67juILiwhdLwOsYyjUqwWEhHdObI0EClOPk+JDtEuTbac59s0pxGpfCBnNNQ5JommifmcMGneW/4Cg7YWw=="
+    },
     "node_modules/concat-map": {
       "version": "0.0.1",
       "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@@ -12850,6 +12856,14 @@
       "integrity": "sha512-VYXZQLtjuvKxxcshuRAwjHnciqZVoXAjTjcqBTz4rKc8qih9g9pI3hbDjmqXaHdgL3v8pV6P8Z335XvHzESxLQ==",
       "license": "MIT"
     },
+    "node_modules/vue-seamless-scroll": {
+      "version": "1.1.23",
+      "resolved": "https://registry.npmmirror.com/vue-seamless-scroll/-/vue-seamless-scroll-1.1.23.tgz",
+      "integrity": "sha512-HBjUub8WwsKJzbFCrwKPDrZn4e+SSbkKgwWtjKtfLwesiFGwSsVxP44/Z6d3kpXy94qIFOiflJH6l0/9pj7SGA==",
+      "dependencies": {
+        "comutils": "^1.1.9"
+      }
+    },
     "node_modules/vue-style-loader": {
       "version": "4.1.3",
       "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz",
@@ -16880,6 +16894,11 @@
         }
       }
     },
+    "comutils": {
+      "version": "1.1.19",
+      "resolved": "https://registry.npmmirror.com/comutils/-/comutils-1.1.19.tgz",
+      "integrity": "sha512-JxXB67juILiwhdLwOsYyjUqwWEhHdObI0EClOPk+JDtEuTbac59s0pxGpfCBnNNQ5JommifmcMGneW/4Cg7YWw=="
+    },
     "concat-map": {
       "version": "0.0.1",
       "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@@ -22324,6 +22343,14 @@
       "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz",
       "integrity": "sha512-VYXZQLtjuvKxxcshuRAwjHnciqZVoXAjTjcqBTz4rKc8qih9g9pI3hbDjmqXaHdgL3v8pV6P8Z335XvHzESxLQ=="
     },
+    "vue-seamless-scroll": {
+      "version": "1.1.23",
+      "resolved": "https://registry.npmmirror.com/vue-seamless-scroll/-/vue-seamless-scroll-1.1.23.tgz",
+      "integrity": "sha512-HBjUub8WwsKJzbFCrwKPDrZn4e+SSbkKgwWtjKtfLwesiFGwSsVxP44/Z6d3kpXy94qIFOiflJH6l0/9pj7SGA==",
+      "requires": {
+        "comutils": "^1.1.9"
+      }
+    },
     "vue-style-loader": {
       "version": "4.1.3",
       "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz",

+ 1 - 0
package.json

@@ -22,6 +22,7 @@
     "vue-amap": "^0.5.10",
     "vue-buffer": "^0.0.1",
     "vue-router": "^3.5.1",
+    "vue-seamless-scroll": "^1.1.23",
     "vuex": "^3.6.2"
   },
   "devDependencies": {

+ 8 - 0
src/api/freezer.js

@@ -53,3 +53,11 @@ export function getSensorData(parameter) {
     params: parameter
   })
 }
+// 绑定保温箱
+export function bindCoolerBox(parameter) {
+  return request({
+    url: '/api/ice-raft/bindCoolerBox',
+    method: 'post',
+    data: parameter
+  })
+}

+ 16 - 0
src/api/refrigerator.js

@@ -44,3 +44,19 @@ export function importIceLocker(parameter) {
     data: parameter
   })
 }
+// 获取冰柜下冰排列表
+export function getIcelockerData(parameter) {
+  return request({
+    url: '/api/ice-locker/geticelocker',
+    method: 'get',
+    params: parameter
+  })
+}
+//出库释冷
+export function startForCold(parameter) {
+  return request({
+    url: '/api/ice-raft-record/start-for-cold',
+    method: 'post',
+    data: parameter
+  })
+}

BIN
src/assets/images/truck.png


BIN
src/assets/vehicle/0070ff.png


BIN
src/assets/vehicle/00fdff.png


BIN
src/assets/vehicle/17abe3.png


BIN
src/assets/vehicle/67C23A.png


BIN
src/assets/vehicle/9f00ff.png


BIN
src/assets/vehicle/E6A23C.png


BIN
src/assets/vehicle/a4579d.png


BIN
src/assets/vehicle/d4237a.png


BIN
src/assets/vehicle/f9ff00.png


BIN
src/assets/vehicle/ff0000.png


+ 0 - 1285
src/components/centerControl.vue

@@ -1,1285 +0,0 @@
-<template>
-  <!-- 中控大屏 -->
-  <div class="center_control">
-    <el-dialog title="提示" :visible.sync="controlVisible" :show-close="false" fullscreen @closed="dialogClose">
-      <template slot="title">
-        <!--Waves Container-->
-        <div class="header">
-          <svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
-            viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
-            <defs>
-              <path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
-            </defs>
-            <g class="parallax">
-              <use xlink:href="#gentle-wave" x="48" y="0" fill="rgba(255,255,255,0.7" />
-              <use xlink:href="#gentle-wave" x="48" y="3" fill="rgba(255,255,255,0.5)" />
-              <use xlink:href="#gentle-wave" x="48" y="5" fill="rgba(255,255,255,0.3)" />
-            </g>
-          </svg>
-          <div class="head_control">
-            <div class="fun_btn1">
-              <div class="title_head_rol center_in" :class="item.flag ? 'active_bgcolor' : ''"
-                v-for="(item,index) in list" :key="index" @click="selectRol(item)">{{item.title}}</div>
-            </div>
-            <div class="fun_btn">
-              <i class="el-icon-full-screen icon_fun" @click="experMode"></i>
-              <i class="el-icon-switch-button icon_fun" @click="close"></i>
-            </div>
-          </div>
-        </div>
-        <!--Waves end-->
-      </template>
-      <div class="card_control">
-        <div class="map_card" v-loading="mapLoading">
-          <div id="container"></div>
-        </div>
-        <div class="card_bottom_control" :class="logisticsFlag ? 'height_300' : 'height_30'">
-          <div style="cursor: pointer;" class="center_in" @click="clickImg">
-            <el-image :class="logisticsFlag ? '' : 'overturn'" style="height: 29px;width: 40px;flex: none;"
-              :src="require('@/assets/images/unfold.png')"></el-image>
-          </div>
-          <div style="width: 100%;height: calc(100% - 30px);" v-show="logisticsFlag">
-            <div class="card_unpack_control">
-              <div style="display: flex;align-items: center;">
-                <div style="width: 260px;margin-right: 10px;">
-                  <el-input size="small" v-model="incubatorName" placeholder="请输入内容"
-                    @input="incubatorSearch"></el-input>
-                </div>
-                <!-- <el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至"
-                  start-placeholder="开始日期" end-placeholder="结束日期">
-                </el-date-picker> -->
-              </div>
-              <div>
-                <el-button type="primary" size="small" :loading="mapLoading" @click="examine"
-                  v-if="currentId == 1">查看实时数据</el-button>
-              </div>
-            </div>
-            <div class="history_warp" v-loading="tableLoading">
-              <el-table ref="multipleTable" label-position="center" :data="tableData"
-                :highlight-current-row="currentId == 2 ? true : false" height="calc(100% - 51px)" border
-                style="width: 100%" @selection-change="handleSelectionChange" @cell-click="selectIncubator"
-                :row-key="(row) => { return row.id }" :key="currentId">
-                <el-table-column reserve-selection type="selection" width="55" v-if="currentId == 1"></el-table-column>
-                <el-table-column type="index" width="50" v-else></el-table-column>
-                <el-table-column prop="name" width="220" label="名称"></el-table-column>
-                <el-table-column prop="sn" width="180" label="SN"></el-table-column>
-                <el-table-column prop="status" align="center" width="70" label="状态">
-                  <template slot-scope="scope">
-                    <div :style="{color: filterColor(scope.row,startStatus,'status')}">
-                      {{initDictvalueil(scope.row,startStatus,'status')}}
-                    </div>
-                  </template>
-                </el-table-column>
-                <el-table-column prop="monitorStatus" align="center" width="80" label="监控状态">
-                  <template slot-scope="scope">
-                    <div :style="{color: filterColor(scope.row,deviceState,'monitorStatus')}">
-                      {{initDictvalueil(scope.row,deviceState,'monitorStatus')}}
-                    </div>
-                  </template>
-                </el-table-column>
-                <el-table-column prop="deviceData.address" label="当前地址"></el-table-column>
-                <el-table-column prop="deviceData.T_t" align="center" width="80" label="最新温度">
-                  <template slot-scope="scope">
-                    <div>{{scope.row.deviceData.T_t || ''}}</div>
-                  </template>
-                </el-table-column>
-                <el-table-column prop="deviceData.T_time" width="180" label="最新记录时间"></el-table-column>
-              </el-table>
-              <div v-if="Total">
-                <pagination :total="Total" :currentPage="Pagination.PageIndex" layout="total, prev, pager, next,jumper"
-                  @changeSize="changeSize" @changeCurrent="changeCurrent">
-                </pagination>
-              </div>
-            </div>
-          </div>
-          <div class="track_visit scale-up-tr" v-if="currentId == 2 && playbackControl">
-            <div class="playback">轨迹回放控制</div>
-            <div class="card_cartoon">
-              <div class="cartoo_title center_in margin_10" @click="startAnimation()">开始动画</div>
-              <div class="cartoo_title center_in" @click="pauseAnimation()">暂停动画</div>
-              <div class="cartoo_title center_in margin_10" @click="resumeAnimation()">继续动画</div>
-              <div class="cartoo_title center_in" @click="stopAnimation()">停止动画</div>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="card_right_information" v-if="currentId == 2" v-loading="timeLoading">
-        <div class="hide_information center_in" v-if="!optionFlag && trackCircle" @click="reelect">
-          <span class="iconfont icon-guiji"></span>
-        </div>
-        <div class="information_card scale-up-tr" v-infinite-scroll="scrollLoad"
-          v-if="optionFlag && timeData.length > 0">
-          <div class="card_time_box" v-for="(item,index) in timeData" :key="index" @click="getTrack(item)">
-            <div class="sn_card_box">{{item.sn}}</div>
-            <div class="box_time">{{item.coolerBoxUserTime}}</div>
-            <div class="box_time">{{item.coolerEndUseTime}}</div>
-          </div>
-        </div>
-        <div class="information_card" v-else-if="optionFlag && timeData.length == 0">
-          <el-empty description="暂无数据"></el-empty>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-  import axios from 'axios'
-  import {
-    getCoolerBox,
-    getCoolerBoxLocus,
-    getHistoryLocus,
-    getNewlocus,
-    getcoolerboxall
-  } from '@/api/incubator'
-  import {
-    startStatus,
-    deviceState
-  } from '@/assets/js/blockSort'
-  import pagination from '@/components/pagination'
-  export default {
-    name: 'centerControl',
-    props: {
-      // 表格label数据
-      // tableData: {
-      //   type: Array,
-      //   default: () => [],
-      // },
-    },
-    components: {
-      pagination,
-    },
-    data() {
-      return {
-        fullScreen: false,
-        input: '',
-        value1: '',
-        logisticsFlag: true,
-        list: [{
-          id: 1,
-          flag: true,
-          title: '实时监控',
-        }, {
-          id: 2,
-          flag: false,
-          title: '历史轨迹',
-        }],
-        controlVisible: false,
-        map: null,
-        currentId: 1,
-        incubatorData: [],
-        incubatorID: null,
-        optionFlag: true,
-        timeData: [],
-        polyline: null,
-        passedPolyline: null,
-        marker: null,
-        endMarker: null,
-        trackList: [],
-        trackPlayback: null,
-        playbackControl: false,
-        trackCircle: false,
-        Total: 0,
-        Pagination: {
-          PageIndex: 1,
-          PageSize: 10,
-        },
-
-        eventSource: [],
-        incubatorSn: [],
-        jointSn: [],
-        realTimeTrajectory: [],
-        carMarker: [],
-        mapLoading: false,
-        tableData: [],
-        tableLoading: false,
-        incubatorName: '',
-        timeLoading: false,
-        startStatus: startStatus(),
-        deviceState: deviceState(),
-        asyncDataLoaded: false,
-        limitNoil: true,
-        timePage: 1,
-        colorIndex: 0,
-      }
-    },
-    computed: {
-      classOption() {
-        return {
-          limitMoveNum: 10,
-          singleHeight: 42,
-          waitTime: 2000,
-        };
-      },
-    },
-    watch: {},
-    mounted() {
-      // this.keyUpSearch()
-    },
-    methods: {
-      // 搜索保温箱
-      incubatorSearch() {
-        this.getList()
-      },
-      // 获取保温箱列表
-      async getList() {
-        this.tableLoading = true
-        var params = {
-          page: this.Pagination.PageIndex,
-          pageSize: this.Pagination.PageSize,
-          showTemp: true,
-          name: this.incubatorName,
-          monitorStatus: 1, //监控中
-        }
-        if (this.currentId == 2) {
-          delete params.monitorStatus
-        }
-        await getCoolerBox(params).then(res => {
-          if (res.code == 200) {
-            res.data.list.forEach(async item => {
-              item.deviceData.address = ''
-              item.deviceData.address = await this.longitudeLatitude(item.deviceData.T_site)
-            })
-            this.tableData = res.data.list
-            this.Total = res.data.count
-            this.$forceUpdate()
-          }
-          this.tableLoading = false
-        }).catch(() => {
-          this.tableLoading = false
-        })
-      },
-      // 更新保温箱实时数据
-      refreshData(event, soleSn) {
-        this.tableData.map(async item => {
-          if (item.sn === soleSn) {
-            item.deviceData.address = await this.longitudeLatitude(event.T_site)
-            item.deviceData.T_rh = event.T_rh
-            item.deviceData.T_t = event.T_t
-            item.deviceData.T_time = event.T_time
-            item.deviceData.T_site = event.T_site
-            return
-          }
-        });
-      },
-      // 选中实时轨迹或者历史轨迹
-      selectRol(event) {
-        if (this.currentId != event.id) {
-          if (event.id == 1) {
-            this.playbackControl = false
-            this.keyUpSearch()
-          } else {
-            this.incubatorSn = []
-            this.examine(true)
-            this.historicalRoute()
-          }
-        }
-        this.list.forEach(item => {
-          if (item.id == event.id) {
-            this.currentId = event.id
-            item.flag = true
-            this.Pagination.PageIndex = 1
-            this.Pagination.PageSize = 10
-            this.getList()
-          } else {
-            item.flag = false
-          }
-        })
-        this.$forceUpdate()
-      },
-      // 普通类型文字匹配
-      initDictvalueil(value, list, type) {
-        let name = ''
-        if (list) {
-          list.forEach(item => {
-            if (value[type] === item.value) {
-              name = item.label
-            }
-          })
-        }
-        return name
-      },
-      // tag颜色获取
-      filterColor(value, list, type) {
-        let color = ''
-        if (list) {
-          list.forEach(item => {
-            if (value[type] === item.value) {
-              color = item.bgcolor
-            }
-          })
-        }
-        return color
-      },
-      // 获取经纬度
-      longitudeLatitude(latitude) {
-        return new Promise((resolve, inject) => {
-          let addressArr = ''
-          var geocoder = new AMap.Geocoder({
-            city: "010", //城市设为北京,默认:“全国”
-            radius: 1000 //范围,默认:500
-          });
-          geocoder.getAddress(latitude, function(status, result) {
-            if (status === 'complete' && result.regeocode) {
-              var address = result.regeocode.formattedAddress;
-              resolve(address)
-            } else {
-              resolve('')
-            }
-          });
-        })
-      },
-      close() {
-        this.controlVisible = false
-      },
-      // 选择
-      handleSelectionChange(event) {
-        let arr = []
-        event.forEach(item => {
-          let list = {
-            sn: item.sn,
-            name: item.name,
-          }
-          arr.push(list)
-        })
-        this.incubatorSn = arr
-      },
-      // 查看实时数据
-      async examine(event) {
-        const that = this
-        that.realTimeTrajectory = []
-
-        function difference(arr1, arr2) {
-          return arr1.filter(item => !arr2.includes(item.sn));
-        }
-
-        const uniqueToFirstArray = difference(that.incubatorSn, that.jointSn);
-        // console.log(uniqueToFirstArray,324)
-        that.jointSn.forEach(item => {
-          that.eventSource[item.sn].close()
-          if (that.carMarker[item.sn]) {
-            if (that.carMarker[item.sn].marker) {
-              that.carMarker[item.sn].marker.setMap(null)
-            }
-            if (that.carMarker[item.sn].startMarker) {
-              that.carMarker[item.sn].startMarker.setMap(null)
-            }
-            if (that.carMarker[item.sn].polyline) {
-              that.carMarker[item.sn].polyline.setMap(null)
-            }
-            that.carMarker[item.sn] = null
-          }
-        })
-        const userData = localStorage.getItem('userList')
-        const deptId = JSON.parse(userData)
-        that.map.setFitView(null, false, [150, 60, 100, 60])
-        if (event == true) {
-          return
-        }
-        if (that.incubatorSn.length > 0) {
-          that.jointSn = that.incubatorSn
-          // 处理 SSE 流
-          for (let i = 0; i < uniqueToFirstArray.length; i++) {
-            that.mapLoading = true
-            const T_sn = uniqueToFirstArray[i].sn
-            const CoolerName = uniqueToFirstArray[i].name
-            await that.getDeviceAttachment(T_sn, CoolerName, deptId)
-            that.mapLoading = false
-          }
-        } else {
-          that.$message({
-            message: '请选择保温箱',
-            type: 'warning'
-          });
-        }
-      },
-      // sse连接保温箱设备
-      getDeviceAttachment(T_sn, CoolerName, deptId) {
-        return new Promise((resolve, inject) => {
-          const that = this
-          that.eventSource[T_sn] = new EventSource(
-            `http://colddeliverytest.coldbaozhida.com:9090/cold_delivery/api/waybill/newlocus?T_sn=${T_sn}&Id=${deptId.dept.id}&CoolerName=${CoolerName}`
-          ); //测试
-          // that.eventSource[T_sn] = new EventSource(
-          //   `https://colddelivery.coldbaozhida.com/cold_delivery/api/waybill/newlocus?T_sn=${T_sn}&Id=${deptId.dept.id}&CoolerName=${CoolerName}`
-          // ); //正式
-          that.eventSource[T_sn].onopen = function(e) {
-            // console.log('Connection to SSE opened.', e);
-          };
-          that.eventSource[T_sn].onmessage = function(e) {
-            resolve()
-            // console.log('Message from SSE stream:', e.data);
-            const arr = JSON.parse(e.data)
-            // console.log('Message from SSE stream:', arr);
-            if (arr.data) {
-              if (arr.code == 200) {
-                that.initMarker(arr.data[0], arr)
-                // 更新数据
-                that.refreshData(arr.data[0], arr.sn)
-              } else {
-                that.jointSn = deleteElementById(that.jointSn, T_sn)
-
-                function deleteElementById(arr, id) {
-                  return arr.filter((item) => item !== id);
-                }
-                that.$message.error(arr.msg);
-                that.eventSource[T_sn].close()
-              }
-            } else {
-              that.eventSource[T_sn].close()
-              that.$message({
-                message: '设备:' + T_sn + '暂无数据!请开启监控设备',
-                type: 'warning'
-              });
-            }
-          };
-          that.eventSource[T_sn].onerror = function(e) {
-            that.mapLoading = false
-            // console.error('Error from SSE stream:', uniqueToFirstArray[i], e);
-          };
-        })
-      },
-      // 初始化坐标点的icon
-      initMarker(location, information) {
-        let that = this
-        let latitude = location.T_site.split(',')
-        let dataList = information.data
-        var trackList = []
-        var correctionTrajectory = []
-        var positions = information.data
-        if (positions.length > 0) {
-          positions.forEach(item => {
-            if (item.T_site != '0,0' && item.T_site) {
-              const data = item.T_site.split(',')
-              let arrTrack = [Number(data[0]), Number(data[1])]
-              let corre = {
-                'x': Number(data[0]),
-                'y': Number(data[1]),
-                'sp': 10,
-                'ag': 130,
-                'tm': convertToTimestamp(item.T_time)
-              }
-
-              function convertToTimestamp(dateString) {
-                return new Date(dateString).getTime();
-              }
-              correctionTrajectory.push(corre)
-              trackList.push(arrTrack)
-            }
-          })
-        }
-        // 生成坐标点icon
-        if (that.carMarker[information.sn] && that.carMarker[information.sn] != null) {
-          if (that.carMarker[information.sn].marker) {
-            that.carMarker[information.sn].marker.setMap(null)
-            let icon = new AMap.Icon({
-              size: new AMap.Size(40, 45),
-              image: require(`@/assets/images/truck.png`),
-              imageSize: new AMap.Size(40, 45),
-            });
-            that.carMarker[information.sn].marker = new AMap.Marker({
-              icon: icon, // 坐标点图标
-              position: [Number(latitude[0]), Number(latitude[1])], // 左边点的经纬度
-              offset: new AMap.Pixel(-10, -30) // 坐标点偏移量
-            });
-            var geocoder = new AMap.Geocoder({
-              city: "010", //城市设为北京,默认:“全国”
-              radius: 1000 //范围,默认:500
-            });
-            geocoder.getAddress([Number(latitude[0]), Number(latitude[1])], function(status, result) {
-              if (status === 'complete' && result.regeocode) {
-                var address = result.regeocode.formattedAddress;
-                // 点标记显示内容,HTML要素字符串
-                var markerContent = '' +
-                  '<div class="incubator_card_map">' +
-                  '   <div class="map_title_incu">' + information.CoolerName + '</div>' +
-                  '   <div class="map_title_incu1">' + information.sn + '</div>' +
-                  '   <div class="map_title_incu1">最新温度: <span>' + location.T_t + '</span></div>' +
-                  '   <div class="map_title_incu2">记录时间: ' + location.T_time + '</div>' +
-                  '   <div class="map_title_incu2">当前地址: ' + address + '</div>' +
-                  '   <div class="map_arrows"></div>' +
-                  '</div>';
-                that.carMarker[information.sn].marker.setLabel({
-                  offset: new AMap.Pixel(-3, -68),
-                  content: markerContent,
-                  direction: 'center',
-                })
-                that.carMarker[information.sn].marker.setMap(that.map)
-              }
-            });
-          }
-          that.carMarker[information.sn].polyline = that.carMarker[information.sn].polyline
-          that.carMarker[information.sn].startMarker = that.carMarker[information.sn].startMarker
-          if (that.carMarker[information.sn].polyline) {
-            that.carMarker[information.sn].polyline.setPath(trackList)
-          }
-        } else {
-          // 创建一个 起点Icon
-          var startIcon = new AMap.Icon({
-            size: new AMap.Size(25, 34),
-            image: '//a.amap.com/jsapi_demos/static/demo-center/icons/dir-marker.png',
-            imageSize: new AMap.Size(135, 40),
-            imageOffset: new AMap.Pixel(-9, -3)
-          });
-          let icon = new AMap.Icon({
-            size: new AMap.Size(40, 45),
-            image: require(`@/assets/images/truck.png`),
-            imageSize: new AMap.Size(40, 45),
-          });
-          that.carMarker[information.sn] = {
-            marker: null,
-            polyline: null,
-            startMarker: null,
-          }
-          // 坐标点 生成方法
-          that.carMarker[information.sn].marker = new AMap.Marker({
-            icon: icon, // 坐标点图标
-            position: [Number(latitude[0]), Number(latitude[1])], // 左边点的经纬度
-            offset: new AMap.Pixel(-10, -30) // 坐标点偏移量
-          });
-          // 起点
-          var startArr = positions[positions.length - 1].T_site.split(',')
-          that.carMarker[information.sn].startMarker = new AMap.Marker({
-            icon: startIcon, // 坐标点图标
-            position: [Number(startArr[0]), Number(startArr[1])], // 左边点的经纬度
-            offset: new AMap.Pixel(-11, -28) // 坐标点偏移量
-          });
-          that.carMarker[information.sn].startMarker.setMap(that.map)
-          var geocoder = new AMap.Geocoder({
-            city: "010", //城市设为北京,默认:“全国”
-            radius: 1000 //范围,默认:500
-          });
-          geocoder.getAddress([Number(latitude[0]), Number(latitude[1])], function(status, result) {
-            if (status === 'complete' && result.regeocode) {
-              var address = result.regeocode.formattedAddress;
-              // 点标记显示内容,HTML要素字符串
-              var markerContent = '' +
-                '<div class="incubator_card_map">' +
-                '   <div class="map_title_incu">' + information.CoolerName + '</div>' +
-                '   <div class="map_title_incu1">' + information.sn + '</div>' +
-                '   <div class="map_title_incu1">最新温度: <span>' + location.T_t + '</span></div>' +
-                '   <div class="map_title_incu2">记录时间: ' + location.T_time + '</div>' +
-                '   <div class="map_title_incu2">当前地址: ' + address + '</div>' +
-                '   <div class="map_arrows"></div>' +
-                '</div>';
-              that.carMarker[information.sn].marker.setLabel({
-                offset: new AMap.Pixel(-3, -68),
-                content: markerContent,
-                direction: 'center',
-              })
-              that.carMarker[information.sn].marker.setMap(that.map)
-              let colorArr = ['#0070ff', '#E6A23C', '#67C23A', '#f9ff00', '#8fff00', '#a0cfff', '#00ff16',
-                '#00fdff', '#9f00ff', '#ff0000',
-              ]
-              that.carMarker[information.sn].polyline = new AMap.Polyline({
-                map: that.map,
-                path: trackList,
-                showDir: true,
-                strokeColor: colorArr[that.colorIndex], //线颜色
-                strokeWeight: 10, //线宽
-                strokeStyle: "solid",
-                lineJoin: 'round',
-                lineCap: 'round',
-              });
-              that.colorIndex++
-              that.carMarker[information.sn].polyline.setMap(that.map)
-              that.map.setFitView(null, false, [150, 60, 100, 60])
-              // var graspRoad;
-              // if (!graspRoad) {
-              //   graspRoad = new AMap.GraspRoad()
-              // }
-              // console.log(correctionTrajectory, 25425)
-              // graspRoad.driving(correctionTrajectory, function(error, result) {
-              //   console.log(error, result, 25425)
-              //   if (!error) {
-              //     var path2 = [];
-              //     var newPath = result.data.points;
-              //     for (var i = 0; i < newPath.length; i += 1) {
-              //       path2.push([newPath[i].x, newPath[i].y])
-              //     }
-              //     var newLine = new AMap.Polyline({
-              //       path: path2,
-              //       strokeWeight: 8,
-              //       strokeOpacity: 0.8,
-              //       strokeColor: '#28F',
-              //       showDir: true
-              //     })
-              //     that.map.add(newLine)
-              //     that.map.setFitView()
-              //   }
-              // })
-            } else {
-              console.error('根据经纬度查询地址失败')
-            }
-          });
-        }
-        that.map.setFitView(null, false, [150, 60, 100, 60])
-      },
-      keyUpSearch() {
-        var that = this
-        // var positions = this.trackList;
-        that.map = new AMap.Map("container", {
-          resizeEnable: true,
-          zoom: 2,
-        });
-        that.map.setFitView()
-      },
-      // 历史轨迹
-      historicalRoute() {
-        var that = this
-        that.map = new AMap.Map("container", {
-          resizeEnable: true,
-          zoom: 2,
-        });
-        that.map.setFitView()
-      },
-      // 选择保温箱
-      selectIncubator(event) {
-        this.$refs.multipleTable.toggleRowSelection(event);
-        if (event.monitorStatus == 4) {
-          this.optionFlag = true
-          this.timePage = 1
-          this.limitNoil = true
-          this.timeData = []
-          this.$message.error('该保温箱暂未绑定平台');
-        } else {
-          this.incubatorID = event.id
-          if (this.currentId == 2) {
-            event.flag = true
-            this.optionFlag = true
-            this.timePage = 1
-            this.limitNoil = true
-            this.timeData = []
-            this.getBoxLocus()
-          }
-        }
-      },
-      // 重选时间段轨迹
-      reelect() {
-        this.optionFlag = true
-      },
-      // 滚动触底
-      scrollLoad() {
-        if (this.limitNoil && this.timeData.length > 0) {
-          this.getBoxLocus()
-        }
-      },
-      // 获取保温箱历史时间段
-      getBoxLocus() {
-        this.timeLoading = true
-        getcoolerboxall({
-          coolerBoxId: this.incubatorID,
-          page: this.timePage,
-          pageSize: 10,
-        }).then(res => {
-          if (res.code == 200) {
-            let arr = res.data.list
-            if (this.limitNoil == true && arr) {
-              this.timeData = this.timeData.concat(arr)
-            }
-            if (arr.length >= 10) {
-              this.timePage = ++this.timePage;
-            } else {
-              // 已经没数据了 不需要增加数据
-              this.limitNoil = false;
-            }
-          } else {
-            this.timeData = []
-          }
-          this.timeLoading = false
-        }).catch(() => {
-          this.timeLoading = false
-        })
-      },
-      // 获取保温箱历史轨迹
-      getTrack(event) {
-        if (this.marker) {
-          this.marker.stopMove();
-        }
-        if (event.sn) {
-          getHistoryLocus({
-            sn: event.sn,
-            start_time: event.coolerBoxUserTime,
-            end_time: event.coolerEndUseTime,
-            // t_id: event.t_id,
-            page: 1,
-            page_z: 999,
-          }).then(res => {
-            if (res.code == 200) {
-              var trackList = []
-              var positions = res.data
-              if (positions && positions.length > 0) {
-                positions.forEach(item => {
-                  if (item.T_site != '0,0' && item.T_site) {
-                    const data = item.T_site.split(',')
-                    trackList.push(data)
-                  }
-                })
-              }
-              if (this.polyline) {
-                this.polyline.setMap(null); // 移除轨迹
-              }
-              this.polyline = null
-              if (this.passedPolyline) {
-                this.passedPolyline.setMap(null)
-              }
-              this.passedPolyline = null
-              if (this.marker) {
-                this.marker.setMap(null)
-              }
-              this.marker = null
-              if (this.endMarker) {
-                this.endMarker.setMap(null)
-              }
-              this.endMarker = null
-              this.trackList = trackList
-              this.optionFlag = false
-              this.trackCircle = true
-              if (trackList.length > 0) {
-                this.initMap(trackList)
-              }
-            }
-          })
-        }
-      },
-      // 历史轨迹
-      initMap(arr) {
-        // 聚焦到标记点位置的方法
-        // this.map.setZoomAndCenter(10, arr[0].split(','))
-        var marker, positions = arr
-        const that = this
-        setTimeout(() => {
-          // 地图渲染完成后修改zoom
-          that.map.setZoom(14);
-          const num = positions.length
-          // 创建一个 终点icon
-          var endIcon = new AMap.Icon({
-            size: new AMap.Size(25, 34),
-            image: '//a.amap.com/jsapi_demos/static/demo-center/icons/dir-marker.png',
-            imageSize: new AMap.Size(135, 40),
-            imageOffset: new AMap.Pixel(-95, -3)
-          });
-          if (positions.length > 0) {
-            // 终点
-            that.endMarker = new AMap.Marker({
-              position: positions[num - 1],
-              icon: endIcon,
-              offset: new AMap.Pixel(-13, -30),
-            });
-            that.map.add(that.endMarker);
-          }
-          var truckIcon = new AMap.Icon({
-            size: new AMap.Size(40, 45),
-            image: require(`@/assets/images/truck.png`),
-            imageSize: new AMap.Size(40, 45),
-          });
-          that.marker = new AMap.Marker({
-            map: that.map,
-            position: positions[0],
-            icon: truckIcon,
-            offset: new AMap.Pixel(-13, -23),
-            autoRotation: true,
-          });
-          // 绘制轨迹
-          that.polyline = new AMap.Polyline({
-            map: that.map,
-            path: positions,
-            showDir: true,
-            strokeColor: "#28F", //线颜色
-            strokeWeight: 10, //线宽
-            strokeStyle: "solid",
-            lineJoin: 'round',
-            lineCap: 'round',
-          });
-          that.passedPolyline = new AMap.Polyline({
-            map: that.map,
-            strokeColor: "#AF5", //线颜色
-            strokeWeight: 10, //线宽
-            strokeOpacity: .7,
-            strokeStyle: "solid",
-            lineJoin: 'round',
-            lineCap: 'round',
-          });
-          that.map.add(that.polyline);
-          that.map.setFitView(null, false, [150, 60, 100, 60]);
-          that.marker.on("moving", function(e) {
-            that.passedPolyline.setPath(e.passedPath);
-          });
-          that.playbackControl = true
-        }, 500)
-      },
-      // 开始动画
-      startAnimation() {
-        var num = this.trackList.length * 3
-        this.optionFlag = false
-        this.marker.moveAlong(this.trackList, num);
-      },
-      // 暂停动画
-      pauseAnimation() {
-        this.marker.pauseMove();
-      },
-      // 继续动画
-      resumeAnimation() {
-        this.marker.resumeMove();
-      },
-      // 停止动画
-      stopAnimation() {
-        this.marker.stopMove();
-      },
-      destroyMap() {
-        this.map && this.map.destroy();
-      },
-      clickImg() {
-        if (this.logisticsFlag) {
-          this.logisticsFlag = false
-        } else {
-          this.logisticsFlag = true
-        }
-      },
-      // 全屏
-      experMode() {
-        const full = localStorage.getItem('fullScreen')
-        if (full == 'true' || full == true) {
-          this.fullScreen = false
-          localStorage.setItem("fullScreen", this.fullScreen);
-          this.exitFullscreen()
-        } else {
-          this.fullScreen = true
-          localStorage.setItem("fullScreen", this.fullScreen);
-          let element = document.documentElement;
-          this.launchFullscreen(element);
-        }
-      },
-      // 全屏
-      launchFullscreen(element) {
-        if (element.requestFullscreen) {
-          element.requestFullscreen();
-        } else if (element.webkitRequestFullscreen) {
-          element.webkitRequestFullscreen();
-        } else if (element.mozRequestFullscreen) {
-          element.mozRequestFullscreen();
-        } else if (element.msRequestFullscreen) {
-          element.msRequestFullscreen();
-        }
-      },
-      // 推出全屏
-      exitFullscreen() {
-        if (document.exitFullscreen) {
-          document.exitFullscreen();
-        } else if (document.webkitExitFullscreen) {
-          document.webkitExitFullscreen();
-        } else if (document.mozCancelFullScreen) {
-          document.mozCancelFullScreen();
-        } else if (document.msExitFullscreen) {
-          document.msExitFullscreen();
-        }
-      },
-      // 弹窗关闭
-      dialogClose() {
-        if (this.jointSn.length > 0) {
-          this.jointSn.forEach(item => {
-            if (this.eventSource[item.sn]) {
-              this.eventSource[item.sn].close()
-            }
-          })
-        }
-        this.map = null
-        this.currentId = 1
-        this.list.forEach((item) => {
-          if (item.id == 1) {
-            item.flag = true
-          } else {
-            item.flag = false
-          }
-        })
-        this.incubatorSn = []
-        this.jointSn = []
-        this.realTimeTrajectory = []
-        this.carMarker = []
-        this.$nextTick(() => {
-          this.$refs.multipleTable.clearSelection();
-        })
-        this.logisticsFlag = true
-      },
-      changeSize(val) {
-        this.Pagination.PageSize = val
-        this.getList()
-      },
-      changeCurrent(val) {
-        this.Pagination.PageIndex = val
-        this.getList()
-      },
-    }
-  }
-</script>
-
-<style lang="scss" scoped>
-  ::v-deep .amap-marker-label {
-    bottom: -3px !important;
-    top: unset !important;
-    border: unset !important;
-    padding: 0px !important;
-    background-color: unset !important;
-  }
-
-  .center_control ::v-deep .el-dialog__header {
-    padding: 0px !important;
-  }
-
-  .center_control ::v-deep .el-dialog__body {
-    padding: 0px !important;
-  }
-
-  #container {
-    position: relative;
-    width: 100%;
-    height: 100%;
-  }
-
-  .head_control {
-    position: absolute;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    display: flex;
-    justify-content: space-between;
-    align-items: flex-end;
-    height: 50px;
-    padding: 0px 20px 0px 20px;
-    z-index: 2025;
-    border-bottom: 1px solid #ffffff;
-    // background-image: linear-gradient(to top, #209cff 0%, #68e0cf 100%);
-    background: linear-gradient(60deg, rgba(32, 156, 255, .5) 0%, rgba(0, 172, 193, .5) 100%);
-  }
-
-  .fun_btn1 {
-    display: flex;
-    align-items: flex-end;
-  }
-
-  .fun_btn {
-    height: 50px;
-    display: flex;
-    align-items: center;
-  }
-
-  .title_head_rol {
-    border-top-right-radius: 5px;
-    border-top-left-radius: 5px;
-    cursor: pointer;
-    font-size: 16px;
-    color: #fff;
-    height: 40px;
-    padding: 0px 15px;
-    -webkit-user-select: none;
-    /* Safari */
-    -moz-user-select: none;
-    /* Firefox */
-    -ms-user-select: none;
-    /* IE/Edge */
-    user-select: none;
-    /* 标准语法 */
-  }
-
-  .active_bgcolor {
-    // background-color: #18a966;
-    // background-image: linear-gradient(to top, #37ecba 0%, #72afd3 100%);
-    background-image: linear-gradient(180deg, #2af598 0%, #009efd 100%);
-  }
-
-  .icon_fun {
-    color: #fff;
-    cursor: pointer;
-    font-size: 30px;
-    margin-left: 10px;
-  }
-
-  .card_control {
-    position: absolute;
-    width: 100%;
-    height: calc(100% - 50px);
-    display: flex;
-    flex-direction: column;
-  }
-
-
-
-  .map_card {
-    width: 100%;
-    // height: 100%;
-    flex: 1;
-  }
-
-  .card_bottom_control {
-    position: relative;
-    border-top: 1px solid #DCDFE6;
-    background-color: #ffffff;
-  }
-
-  .height_300 {
-    height: 300px;
-  }
-
-  .height_30 {
-    height: 30px;
-  }
-
-  .card_unpack_control {
-    padding: 0px 10px 5px 10px;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-  }
-
-  .history_warp {
-    height: calc(100% - 35px);
-    width: 100%;
-    overflow: hidden;
-  }
-
-  ::v-deep .history_warp .current-row>td.el-table__cell {
-    background-color: #9eb1f7 !important;
-  }
-
-  .overturn {
-    transform: rotate(180deg);
-  }
-
-  .header {
-    position: relative;
-    text-align: center;
-    background: linear-gradient(60deg, rgba(0, 172, 193, 1) 0%, rgba(84, 58, 183, 1) 100%);
-    color: white;
-  }
-
-  .waves {
-    position: relative;
-    width: 100%;
-    height: 50px;
-    margin-bottom: -7px;
-  }
-
-  .parallax>use {
-    animation: move-forever 25s cubic-bezier(.55, .5, .45, .5) infinite;
-  }
-
-  .parallax>use:nth-child(1) {
-    animation-delay: -2s;
-    animation-duration: 7s;
-  }
-
-  .parallax>use:nth-child(2) {
-    animation-delay: -3s;
-    animation-duration: 10s;
-  }
-
-  .parallax>use:nth-child(3) {
-    animation-delay: -4s;
-    animation-duration: 13s;
-  }
-
-  .parallax>use:nth-child(4) {
-    animation-delay: -5s;
-    animation-duration: 20s;
-  }
-
-  @keyframes move-forever {
-    0% {
-      transform: translate3d(-90px, 0, 0);
-    }
-
-    100% {
-      transform: translate3d(85px, 0, 0);
-    }
-  }
-
-  /*Shrinking for mobile*/
-  @media (max-width: 768px) {
-    .waves {
-      height: 40px;
-      min-height: 40px;
-    }
-
-    .content {
-      height: 30vh;
-    }
-
-    h1 {
-      font-size: 24px;
-    }
-  }
-
-  ::v-deep .incubator_card_map {
-    position: relative;
-    width: 190px;
-    background-color: #fff;
-    border: 1px solid #DCDFE6;
-    padding: 5px;
-    border-radius: 8px;
-    // overflow: hidden;
-  }
-
-  ::v-deep .map_title_incu {
-    font-size: 16px;
-    font-weight: 600;
-    margin-bottom: 4px;
-  }
-
-  ::v-deep .map_title_incu1 {
-    font-size: 14px;
-
-    span {
-      font-weight: bold;
-      color: #67C23A;
-    }
-  }
-
-  ::v-deep .map_title_incu2 {
-    white-space: normal;
-    font-size: 12px;
-    margin: 2px 0px;
-  }
-
-  ::v-deep .map_arrows {
-    position: absolute;
-    bottom: 0px;
-    left: 90px;
-  }
-
-  ::v-deep .map_arrows::before {
-    position: absolute;
-    content: '';
-    border-top: 11px #DCDFE6 solid;
-    border-left: 10px transparent solid;
-    border-right: 10px transparent solid;
-    border-bottom: 10px transparent solid;
-  }
-
-  ::v-deep .map_arrows::after {
-    position: absolute;
-    content: '';
-    border-top: 10px #fff solid;
-    border-left: 10px transparent solid;
-    border-right: 10px transparent solid;
-    border-bottom: 10px transparent solid;
-  }
-
-  .card_right_information {
-    position: absolute;
-    top: 60px;
-    right: 10px;
-  }
-
-  .information_card {
-    width: 260px;
-    max-height: 400px;
-    overflow: hidden auto;
-    border-radius: 5px;
-    background-color: #ffffff;
-    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-  }
-
-  .hide_information {
-    cursor: pointer;
-    width: 50px;
-    height: 50px;
-    background-color: #ffffff;
-    border-radius: 50%;
-    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-
-    span {
-      color: #009efd;
-      font-size: 30px;
-    }
-  }
-
-  .track_visit {
-    position: absolute;
-    right: 10px;
-    top: -130px;
-    width: 240px;
-    height: auto;
-    background-color: #ffffff;
-    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-    padding: 10px;
-    border-radius: 5px;
-
-    .playback {
-      font-size: 15px;
-      padding-bottom: 10px;
-    }
-  }
-
-  .card_cartoon {
-    display: flex;
-    flex-direction: row;
-    flex-wrap: wrap;
-  }
-
-  .cartoo_title {
-    cursor: pointer;
-    margin-bottom: 8px;
-    width: 7rem;
-    color: #25A5F7;
-    border: 1px solid #25A5F7;
-    border-radius: 30px;
-    padding: 2px 0px;
-  }
-
-  .margin_10 {
-    margin-right: 10px;
-  }
-
-  .card_time_box {
-    cursor: pointer;
-    padding: 6px 10px;
-    border-bottom: 1px solid #E4E7ED;
-  }
-
-  .sn_card_box {
-    font-size: 16px;
-    font-weight: bold;
-  }
-
-  .box_time {
-    font-size: 14px;
-  }
-
-  .scale-up-tr {
-    -webkit-animation: scale-up-tr 0.4s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
-    animation: scale-up-tr 0.4s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
-  }
-
-  @-webkit-keyframes scale-up-tr {
-    0% {
-      -webkit-transform: scale(0.5);
-      transform: scale(0.5);
-      -webkit-transform-origin: 100% 0%;
-      transform-origin: 100% 0%;
-    }
-
-    100% {
-      -webkit-transform: scale(1);
-      transform: scale(1);
-      -webkit-transform-origin: 100% 0%;
-      transform-origin: 100% 0%;
-    }
-  }
-
-  @keyframes scale-up-tr {
-    0% {
-      -webkit-transform: scale(0.5);
-      transform: scale(0.5);
-      -webkit-transform-origin: 100% 0%;
-      transform-origin: 100% 0%;
-    }
-
-    100% {
-      -webkit-transform: scale(1);
-      transform: scale(1);
-      -webkit-transform-origin: 100% 0%;
-      transform-origin: 100% 0%;
-    }
-  }
-</style>

+ 8 - 3
src/components/forms.vue

@@ -90,9 +90,10 @@
           </el-form-item>
           <el-form-item :label-width="item.labelWidth" :label="item.label" :prop="item.field"
             :rules="detail ? item.rules : {}" v-if="item.type === 'searchSelect'">
-            <el-select :id="item.field" v-model="ruleForm[`${item.field}`]" v-loadmore="handleScroll" filterable remote
-              :remote-method="(query) => remoteMethod(query, item.field)" :placeholder="item.placeholder"
-              :disabled="item.disabled" style="width: 100%" @change="(row) => changeOption(row, item.field)">
+            <el-select :id="item.field" v-model="ruleForm[`${item.field}`]" v-loadmore="handleScroll" filterable
+              :multiple="item.multiple" remote :remote-method="(query) => remoteMethod(query, item.field)"
+              :placeholder="item.placeholder" :disabled="item.disabled" style="width: 100%"
+              @change="(row) => changeOption(row, item.field)">
               <el-option v-for="(element, i) in item.options" :label="element.label" :value="`${element.value}`"
                 :key="i" />
             </el-select>
@@ -741,4 +742,8 @@
     // display: none;
     padding: 0px;
   }
+
+  ::v-deep .el-select__input {
+    color: #ffffff;
+  }
 </style>

+ 9 - 3
src/components/tables.vue

@@ -95,7 +95,7 @@
           </template>
         </el-table-column>
         <el-table-column :prop="item.field" :label="item.label" :width="item.colWidth" :align="item.align"
-          v-else-if="['provUser.isorders','provUser.userType','customer.type','tbFillData.productMediaId','iceRaftRecord.status'].includes(item.field)">
+          v-else-if="['provUser.isorders','provUser.userType','customer.type','tbFillData.productMediaId','iceRaftRecord.status','iceRaftRecord.status'].includes(item.field)">
           <template slot-scope="scope">
             <div :style="{color: filterColoril(scope.row,item.options,item.field)}">
               {{initDictvalue(scope.row,item.options,item.field)}}
@@ -131,6 +131,12 @@
           </template>
         </el-table-column>
         <el-table-column :prop="item.field" :label="item.label" :width="item.colWidth" :align="item.align"
+          v-else-if="item.field == 'for_cold_cooler_time'">
+          <template slot-scope="scope">
+            <div>{{scope.row[item.field] || ''}}</div>
+          </template>
+        </el-table-column>
+        <el-table-column :prop="item.field" :label="item.label" :width="item.colWidth" :align="item.align"
           v-else-if="item.field == 'location'">
           <template slot-scope="scope">
             <div v-if="scope.row.iceRaftRecord">
@@ -270,7 +276,7 @@
       }
     },
     methods: {
-      geticeTime(event){
+      geticeTime(event) {
         let specificDateTime = event.iceRaftRecord.ice_use_time
         const specificDate = new Date(specificDateTime);
         // 获取当前时间
@@ -282,7 +288,7 @@
         const minutes = Math.floor((timeDifference % 3600000) / 60000);
         const seconds = Math.floor((timeDifference % 60000) / 1000);
         let time = ''
-        if(minutes){
+        if (minutes) {
           time = hours + 'h' + minutes + 'm'
         }
         return time

+ 1 - 1
src/components/treeTable.vue

@@ -21,7 +21,7 @@
           :align="item.align" v-else-if="item.field == 'index'">
         </el-table-column>
         <el-table-column :prop="item.field" :label="item.label" :width="item.colWidth" :align="item.align"
-          v-else-if="['isIceReleaseCold','isCoolerReleaseCold','isOutStorage'].includes(item.field)">
+          v-else-if="['isIceReleaseCold','isCoolerReleaseCold','isOutStorage','iceRaftManage'].includes(item.field)">
           <template slot-scope="scope">
             <div :style="{color: filterColor(scope.row,item.options,item.field)}">
               {{initDictvalueil(scope.row,item.options,item.field)}}

+ 56 - 0
src/config/iceManagement.js

@@ -0,0 +1,56 @@
+// 管理员菜单intendant
+export const iceRouter = {
+  name: 'index',
+  path: '/',
+  component: () => import('@/views/common/Base'),
+  redirect: '/IceManagement',
+  children: [{
+    path: '/IceManagement',
+    name: 'IceManagement',
+    meta: {
+      icon: 'icon-bingpaiguanli',
+      title: '冰排管理'
+    },
+    component: () => import('@/views/IceCreamFreezer/IceManagement'),
+  }, {
+    path: '/IceTracingManagement',
+    name: 'IceTracingManagement',
+    meta: {
+      icon: 'icon-iceTracing',
+      title: '冰排追溯管理'
+    },
+    component: () => import('@/views/IceCreamFreezer/IceTracingManagement'),
+  }, {
+    path: '/IncubatorManagement',
+    name: 'IncubatorManagement',
+    meta: {
+      icon: 'icon-baowenxiangguanli',
+      title: '保温箱管理'
+    },
+    component: () => import('@/views/incubator/IncubatorManagement'),
+  }, {
+    path: '/IncubatorTraceability',
+    name: 'IncubatorTraceability',
+    meta: {
+      icon: 'icon-trace',
+      title: '保温箱追溯'
+    },
+    component: () => import('@/views/incubator/IncubatorTraceability'),
+  }, {
+    path: '/FreezerManagement',
+    name: 'FreezerManagement',
+    meta: {
+      icon: 'icon-binggui',
+      title: '冷冻柜管理'
+    },
+    component: () => import('@/views/IceCreamFreezer/FreezerManagement'),
+  }, {
+    path: '/incubatorView',
+    name: 'incubatorView',
+    meta: {
+      icon: 'icon-trace',
+      title: '设备定位'
+    },
+    component: () => import('@/views/page/incubatorView'),
+  }]
+}

+ 10 - 3
src/router/generator-routers.js

@@ -4,6 +4,9 @@ import {
 import {
   deliverymanRouter
 } from '@/config/deliveryman'
+import {
+  iceRouter
+} from '@/config/iceManagement'
 // 前端未找到页面路由(固定不用改)
 const notFoundRouter = {
   name: 'FourOhFour',
@@ -97,10 +100,14 @@ export const generatorDynamicRouter = arrType => {
       if (arrType.deptId === 0) {
         routers.push(companyRouter)
       } else {
-        if (arrType.type == 1) {
-          routers.push(intendantRouter)
+        if (arrType.dept.iceRaftManage) {
+          routers.push(iceRouter)
         } else {
-          routers.push(deliverymanRouter)
+          if (arrType.type == 1) {
+            routers.push(intendantRouter)
+          } else {
+            routers.push(deliverymanRouter)
+          }
         }
       }
     }

+ 1 - 0
src/store/modules/user.js

@@ -64,6 +64,7 @@ const user = {
                 deptId: res.data.user.deptId,
                 userType: res.data.user.userType,
                 type: res.data.user.type,
+                dept: res.data.user.dept,
               }
               const roles = [{
                 action: 'add',

+ 2 - 1
src/utils/request.js

@@ -9,8 +9,9 @@ import {
   refreshToken
 } from '@/api/login'
 // 创建 axios 实例
+const Url = process.env.VUE_APP_BASE_API
 // const Url = "https://colddelivery.coldbaozhida.com/cold_delivery"
-const Url = "http://colddeliverytest.coldbaozhida.com:9090/cold_delivery" //测试
+// const Url = "http://colddeliverytest.coldbaozhida.com:9090/cold_delivery" //测试
 const token = localStorage.getItem('T_tokey')
 // const Url = "http://192.168.11.77:6280" //测试
 const request = axios.create({

+ 94 - 2
src/views/IceCreamFreezer/FreezerManagement.vue

@@ -60,6 +60,24 @@
       </template>
       <thermography ref="thermo" :waybillNo="waybillNo" :timeData="timeQuantum"></thermography>
     </el-dialog>
+    <!-- 冷冻柜冰排列表 -->
+    <el-dialog title="冰排列表" :visible.sync="freezerIceVisible" :close-on-click-modal="false" width="80%"
+      @close="iceClose">
+      <div>
+        <!-- 表单 -->
+        <tables ref="refIce" :tableList="freezerIceList" :tableData="freezerIceData"></tables>
+        <!-- 分页 -->
+        <div class="card_ice_bottom" v-if="icePagination.Total">
+          <pagination :total="icePagination.Total" :currentPage="icePagination.PageIndex" :pager-countnum="5"
+            layout="total, sizes, prev, pager, next" @changeSize="iceSize" @changeCurrent="iceCurrent">
+          </pagination>
+          <div style="display: flex;align-items: center;">
+            <el-button @click="freezerIceVisible = false">关闭</el-button>
+            <el-button type="primary" :loading="iceLoading" @click="releaseColdStorage">出库释冷</el-button>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -69,7 +87,9 @@
     addIcelocker,
     putIcelocker,
     delIcelocker,
-    importIceLocker
+    importIceLocker,
+    getIcelockerData,
+    startForCold
   } from '@/api/refrigerator'
   import {
     getDevice
@@ -82,7 +102,8 @@
   import {
     formRules,
     employee,
-    incubator
+    incubator,
+    iceList
   } from "./refrigerator.js";
   import {
     startStatus,
@@ -209,6 +230,16 @@
         timer: null, //定时器名称
         dialogVisible: false,
         waybillNo: '',
+        // 冰排列表
+        freezerIceVisible: false,
+        freezerIceList: iceList(),
+        freezerIceData: [],
+        icePagination: {
+          Total: 0,
+          PageIndex: 1,
+          PageSize: 10,
+        },
+        iceLoading: false,
       }
     },
     beforeDestroy() {
@@ -336,6 +367,47 @@
           this.$nextTick(() => {
             this.$refs.thermo.getProbe()
           })
+        } else if (type == 'cooling') {
+          this.freezerIceVisible = true
+          this.getIceData()
+        }
+      },
+      // 获取冷冻柜下的冰排列表
+      getIceData() {
+        getIcelockerData({
+          page: this.icePagination.PageIndex,
+          pageSize: this.icePagination.PageSize,
+        }).then(res => {
+          if (res.code == 200) {
+            this.freezerIceData = res.data.list
+            this.icePagination.Total = res.data.count
+          }
+        })
+      },
+      // 选择新排出库释冷
+      releaseColdStorage() {
+        const arrID = this.$refs.refIce.waybillIds
+        let arrList = []
+        arrID.forEach(item => {
+          arrList.push(String(item.iceRaftRecord.id))
+        })
+        if (arrList.length != 0) {
+          startForCold({
+            id: arrList,
+          }).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                message: res.msg,
+                type: 'success'
+              });
+              this.getIceData()
+            }
+          })
+        } else {
+          this.$message({
+            message: '请先选择需要批量操作的冰排',
+            type: 'warning'
+          });
         }
       },
       // 选择时间
@@ -454,6 +526,15 @@
         this.Paginationil.PageIndex = val
         this.getDeviceList()
       },
+      // 冷冻柜冰排列表
+      iceSize() {
+        this.icePagination.PageIndex = val
+        this.getIceData()
+      },
+      iceCurrent() {
+        this.icePagination.PageSize = val
+        this.getIceData()
+      },
       // 清空表单
       closeDialog() {
         this.$refs.childRules.resetCheck();
@@ -462,6 +543,10 @@
       temperatureClose() {
         this.timeQuantum = [this.getTime(new Date(new Date().toLocaleDateString())), this.getTime(new Date())]
       },
+      // 冰排关闭弹窗
+      iceClose() {
+        this.freezerIceVisible = false
+      },
       closeDialogil() {
         this.$refs.incubatorRules.resetCheck();
         this.$refs.refIncubator.clearSelected();
@@ -500,4 +585,11 @@
     flex: none;
     margin-right: 5px;
   }
+
+  .card_ice_bottom {
+    margin-top: 10px;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+  }
 </style>

+ 134 - 9
src/views/IceCreamFreezer/IceManagement.vue

@@ -5,7 +5,7 @@
       @searchProtocol="searchProtocol"></actionBar>
     <div class="card_content">
       <!-- 表单 -->
-      <tables :tableList="tableList" :tableData="tableData" @buttonData="buttonData"></tables>
+      <tables ref="refWaybill" :tableList="tableList" :tableData="tableData" @buttonData="buttonData"></tables>
       <!-- 分页 -->
       <div v-if="Total">
         <pagination :total="Total" :currentPage="Pagination.PageIndex" @changeSize="changeSize"
@@ -16,7 +16,7 @@
     <el-dialog :title="staffTitle" :visible.sync="staffDialogVisible" width="600px" :close-on-click-modal="false"
       @close="closeDialog">
       <forms ref="childRules" :iceBank="true" :iceTracing="iceTracing" :formNewList="formRuleList" :ruleForm="ruleForm"
-        labelWidth="100px">
+        labelWidth="100px" @handleScroll="handleScroll" @remoteMethod="remoteMethod">
       </forms>
       <span slot="footer" class="dialog-footer" v-if="operationType != 'logs'">
         <el-button plain @click="staffDialogVisible = false">取 消</el-button>
@@ -31,8 +31,12 @@
     getIceRaft,
     addIceRaft,
     putIceRaft,
-    delIceRaft
+    delIceRaft,
+    bindCoolerBox
   } from '@/api/freezer'
+  import {
+    getCoolerBox
+  } from '@/api/incubator.js'
   import actionBar from '@/components/actionBar'
   import tables from '@/components/tables'
   import pagination from '@/components/pagination'
@@ -41,7 +45,8 @@
     formRules,
     formRulesCold,
     employee,
-    employeeCold
+    employeeCold,
+    bindingIncubator
   } from "./freezer.js";
   import {
     iceraftStatus
@@ -60,6 +65,10 @@
           type: 'add',
           title: '添加',
           icon: 'el-icon-plus',
+        }, {
+          type: 'binding',
+          title: '绑定冰排',
+          icon: 'el-icon-link',
         }],
         formList: [{
           type: 'input',
@@ -93,9 +102,12 @@
           code: '',
           status: null,
           freezeClaim: [],
+          coolerBoxId: [],
           label: '',
           suitableForCold: null,
+          forColdTime: null,
           iceColdAddress: '',
+          sort: null,
         },
         confirmLoading: false,
         selectingData: {},
@@ -103,6 +115,10 @@
         // 是否释冷
         iceColdFlag: false,
         userList: {},
+        staffName: '',
+        page: 1,
+        limitNoil: true,
+        iceCode: [],
       }
     },
     mounted() {
@@ -164,7 +180,9 @@
               freezeClaim: turnNum(this.ruleForm.freezeClaim),
               label: this.ruleForm.label,
               suitableForCold: Number(this.ruleForm.suitableForCold),
+              forColdTime: Number(this.ruleForm.forColdTime),
               iceColdAddress: this.ruleForm.iceColdAddress,
+              sort: Number(this.ruleForm.sort),
             }
             addIceRaft(params).then(res => {
               if (res.code == 200) {
@@ -173,8 +191,8 @@
                   type: 'success'
                 });
                 this.getList()
+                this.staffDialogVisible = false
               }
-              this.staffDialogVisible = false
               this.confirmLoading = false
             }).catch(() => {
               this.confirmLoading = false
@@ -188,7 +206,9 @@
               freezeClaim: turnNum(this.ruleForm.freezeClaim),
               label: this.ruleForm.label,
               suitableForCold: Number(this.ruleForm.suitableForCold),
+              forColdTime: Number(this.ruleForm.forColdTime),
               iceColdAddress: this.ruleForm.iceColdAddress,
+              sort: Number(this.ruleForm.sort),
             }
             putIceRaft(params).then(res => {
               if (res.code == 200) {
@@ -197,8 +217,26 @@
                   type: 'success'
                 });
                 this.getList()
+                this.staffDialogVisible = false
+              }
+              this.confirmLoading = false
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+          } else if (this.operationType == 'binding') {
+            var params = {
+              code: this.iceCode,
+              coolerBoxId: Number(this.ruleForm.coolerBoxId),
+            }
+            bindCoolerBox(params).then(res => {
+              if (res.code == 200) {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success'
+                });
+                this.getList()
+                this.staffDialogVisible = false
               }
-              this.staffDialogVisible = false
               this.confirmLoading = false
             }).catch(() => {
               this.confirmLoading = false
@@ -211,6 +249,11 @@
       buttonData(row, type) {
         this.selectingData = row
         this.operationType = type
+        if (this.iceColdFlag) {
+          this.formRuleList = formRulesCold()
+        } else {
+          this.formRuleList = formRules()
+        }
         if (type == 'edit') {
           this.iceTracing = false
           this.staffTitle = '编辑'
@@ -223,6 +266,8 @@
               this.ruleForm.label = row.label
               this.ruleForm.suitableForCold = row.suitableForCold
               this.ruleForm.iceColdAddress = row.iceColdAddress
+              this.ruleForm.forColdTime = row.forColdTime
+              this.ruleForm.sort = row.sort
             })
           })
         } else if (type == 'logs') {
@@ -246,10 +291,90 @@
         }
       },
       openModel(type) {
-        this.iceTracing = true
-        this.staffTitle = '添加'
-        this.staffDialogVisible = true
         this.operationType = type
+        if (type == 'add') {
+          this.iceTracing = true
+          this.staffTitle = '添加'
+          this.staffDialogVisible = true
+          if (this.iceColdFlag) {
+            this.formRuleList = formRulesCold()
+          } else {
+            this.formRuleList = formRules()
+          }
+        } else if (type == 'binding') {
+          const arrID = this.$refs.refWaybill.waybillIds
+          let arrList = []
+          arrID.forEach(item => {
+            arrList.push(item.code)
+          })
+          this.iceCode = arrList
+          if (arrList.length != 0) {
+            this.ruleForm.coolerBoxId = []
+            this.staffDialogVisible = true
+            this.staffTitle = '绑定保温箱'
+            this.formRuleList = bindingIncubator()
+            this.getIncubator()
+          } else {
+            this.$message({
+              message: '请先选择需要批量操作的冰排',
+              type: 'warning'
+            });
+          }
+        }
+      },
+      handleScroll() {
+        if (this.limitNoil) {
+          this.getIncubator()
+        }
+      },
+      remoteMethod(value) {
+        this.formRuleList.forEach(item => {
+          if (item.type == 'searchSelect') {
+            item.options = []
+          }
+        })
+        this.page = 1
+        this.limitNoil = true
+        this.staffName = value
+        this.getIncubator()
+      },
+      // 获取保温箱列表
+      getIncubator() {
+        let params = {
+          page: this.page,
+          pageSize: 10,
+          status: '2',
+          name: this.staffName,
+        }
+        getCoolerBox(params).then(res => {
+          if (res.code == 200) {
+            let arr = res.data.list
+            let arrList = []
+            arr.forEach(item1 => {
+              var arrData = {
+                label: null,
+                value: null,
+              }
+              arrData.label = item1.name
+              arrData.value = item1.id
+              arrList.push(arrData)
+            })
+            if (this.limitNoil == true) {
+              this.formRuleList.forEach(item => {
+                if (item.type == 'searchSelect') {
+                  item.options = item.options.concat(arrList)
+                }
+              })
+              // this.thermostat.options = this.thermostat.options.concat(arrList)
+            }
+            if (arrList.length >= 10) {
+              this.page = ++this.page;
+            } else {
+              // 已经没数据了 不需要增加数据
+              this.limitNoil = false;
+            }
+          }
+        })
       },
       // 删除冰排
       deleteUser(id) {

+ 116 - 10
src/views/IceCreamFreezer/freezer.js

@@ -4,8 +4,8 @@ import {
 } from '@/assets/js/blockSort'
 export const employee = () => {
   return [{
-    field: 'index',
-    label: '序号',
+    field: 'selection',
+    label: '多选',
     align: 'center',
   }, {
     field: 'code',
@@ -25,6 +25,10 @@ export const employee = () => {
     label: '冷冻要求',
     align: 'center',
   }, {
+    field: 'coolerBoxName',
+    label: '绑定保温箱',
+    align: 'center',
+  }, {
     field: 'action',
     label: '操作',
     colWidth: '260px',
@@ -49,8 +53,8 @@ export const employee = () => {
 }
 export const employeeCold = () => {
   return [{
-    field: 'index',
-    label: '序号',
+    field: 'selection',
+    label: '多选',
     align: 'center',
   }, {
     field: 'code',
@@ -74,10 +78,18 @@ export const employeeCold = () => {
     label: '释冷温度',
     align: 'center',
   }, {
+    field: 'forColdTime',
+    label: '释冷要求',
+    align: 'center',
+  }, {
     field: 'iceColdAddress',
     label: '释冷地点',
     align: 'center',
   }, {
+    field: 'coolerBoxName',
+    label: '绑定保温箱',
+    align: 'center',
+  }, {
     field: 'action',
     label: '操作',
     colWidth: '260px',
@@ -119,7 +131,7 @@ export const formRules = () => {
     type: 'input',
     colWidth: 24,
     rules: [{
-      required: true,
+      required: false,
       message: '请输入冰排备注',
       trigger: 'blur'
     }]
@@ -149,7 +161,32 @@ export const formRules = () => {
       message: '请输入冷冻时间',
       trigger: 'blur'
     }]
-  }, ]
+  }, {
+    field: 'sort',
+    label: '排序',
+    placeholder: '请输入排序编号',
+    type: 'input',
+    colWidth: 24,
+    rules: [{
+      required: false,
+      message: '请输入排序编号',
+      trigger: 'blur'
+    }, {
+      required: false,
+      validator: (rule, value, callback) => {
+        if (!value && rule.required) {
+          return callback(new Error('请输入排序编号'));
+        }
+        if (value) {
+          if (!/^(\d+)?(\.\d+)?$/.test(value)) {
+            return callback(new Error('请输入有效的数值'));
+          }
+        }
+        return callback();
+      },
+      trigger: ['blur', 'change']
+    }]
+  }]
 }
 export const formRulesCold = () => {
   return [{
@@ -170,7 +207,7 @@ export const formRulesCold = () => {
     type: 'input',
     colWidth: 24,
     rules: [{
-      required: true,
+      required: false,
       message: '请输入冰排备注',
       trigger: 'blur'
     }]
@@ -193,6 +230,7 @@ export const formRulesCold = () => {
     type: 'select',
     colWidth: 24,
     multiple: true,
+    createEntry: true,
     options: freezingRequirement(),
     rules: [{
       required: true,
@@ -207,20 +245,88 @@ export const formRulesCold = () => {
     colWidth: 24,
     unit: '℃',
     rules: [{
-      required: true,
+      required: false,
       message: '请输入冰排释冷温度',
       trigger: 'blur'
     }]
   }, {
+    field: 'forColdTime',
+    label: '释冷要求',
+    placeholder: '请输入冰排释冷要求',
+    type: 'input',
+    colWidth: 24,
+    unit: '小时',
+    rules: [{
+      required: false,
+      message: '请输入冰排释冷要求',
+      trigger: 'blur'
+    }, {
+      required: false,
+      validator: (rule, value, callback) => {
+        if (!value && rule.required) {
+          return callback(new Error('请输入释冷要求'));
+        }
+        if (value) {
+          if (!/^(\d+)?(\.\d+)?$/.test(value)) {
+            return callback(new Error('请输入有效的数值'));
+          }
+        }
+        return callback();
+      },
+      trigger: ['blur', 'change']
+    }]
+  }, {
     field: 'iceColdAddress',
     label: '释冷地点',
     placeholder: '请输入释冷地点',
     type: 'input',
     colWidth: 24,
     rules: [{
-      required: true,
+      required: false,
       message: '请输入释冷地点',
       trigger: 'blur'
     }]
-  }, ]
+  }, {
+    field: 'sort',
+    label: '排序',
+    placeholder: '请输入排序编号',
+    type: 'input',
+    colWidth: 24,
+    rules: [{
+      required: false,
+      message: '请输入排序编号',
+      trigger: 'blur'
+    }, {
+      required: false,
+      validator: (rule, value, callback) => {
+        if (!value && rule.required) {
+          return callback(new Error('请输入排序编号'));
+        }
+        if (value) {
+          if (!/^(\d+)?(\.\d+)?$/.test(value)) {
+            return callback(new Error('请输入有效的数值'));
+          }
+        }
+        return callback();
+      },
+      trigger: ['blur', 'change']
+    }]
+  }]
+}
+// 绑定保温箱
+export const bindingIncubator = () => {
+  return [{
+    field: 'coolerBoxId',
+    label: '保温箱',
+    placeholder: '请选择保温箱',
+    type: 'searchSelect',
+    colWidth: 24,
+    // createEntry: true,
+    options: [],
+    rules: [{
+      required: true,
+      message: '请选择保温箱',
+      trigger: 'blur'
+    }]
+  }]
 }

+ 10 - 2
src/views/IceCreamFreezer/iceRaft.js

@@ -40,13 +40,17 @@ export const employee = () => {
     label: '冰排释冷',
     children: [{
       field: 'iceRaftRecord.start_ice_cold_time',
-      label: '释冷日期',
+      label: '开始时间',
       align: 'center',
     }, {
-      field: 'iceRaftRecord.start_ice_cold_time',
+      field: 'iceRaftRecord.coolingTime',
       label: '释冷时间',
       align: 'center',
     }, {
+      field: 'iceRaftRecord.forColdTime',
+      label: '释冷要求',
+      align: 'center',
+    }, {
       field: 'suitableForCold',
       label: '释冷温度',
       align: 'center',
@@ -64,6 +68,10 @@ export const employee = () => {
     label: '使用时间',
     align: 'center',
   }, {
+    field: 'iceRaftRecord.returnDate',
+    label: '归还时间',
+    align: 'center',
+  }, {
     field: 'iceRaftRecord.ice_use_users',
     label: '使用人员',
     align: 'center',

+ 46 - 2
src/views/IceCreamFreezer/refrigerator.js

@@ -13,7 +13,46 @@ export const incubator = () => {
     align: 'center',
   }]
 }
-
+export const iceList = () => {
+  return [{
+    field: 'selection',
+    label: '多选',
+    align: 'center',
+  }, {
+    field: 'code',
+    label: '编号',
+    align: 'center',
+  }, {
+    field: 'label',
+    label: '备注',
+    align: 'center',
+  }, {
+    field: 'iceRaftRecord.status',
+    label: '状态',
+    align: 'center',
+    options: [{
+      bgcolor: '#fa3534',
+      label: '冷冻中',
+      value: '1',
+    }, {
+      bgcolor: '#67C23A',
+      label: '待使用',
+      value: '2',
+    }]
+  }, {
+    field: 'freezeClaim',
+    label: '冷冻要求',
+    align: 'center',
+  }, {
+    field: 'freezeDuration',
+    label: '冷冻时间',
+    align: 'center',
+  }, {
+    field: 'iceRaftRecord.inStorageTime',
+    label: '入库时间',
+    align: 'center',
+  }]
+}
 export const employee = () => {
   return [{
     field: 'index',
@@ -43,9 +82,14 @@ export const employee = () => {
   }, {
     field: 'action',
     label: '操作',
-    colWidth: '270px',
+    colWidth: '360px',
     align: 'center',
     labelButton: [{
+      type: 'cooling',
+      label: '冰排释冷',
+      // icon: 'el-icon-s-order',
+      style: 'primary',
+    }, {
       type: 'record',
       label: '记录',
       icon: 'el-icon-s-order',

+ 11 - 2
src/views/common/topNav.vue

@@ -1,7 +1,8 @@
 <template>
   <div class="card_head">
     <el-image style="height: 35px;width: 35px;flex: none;" :src="require('@/assets/logo3.png')"></el-image>
-    <div class="head_title">智配送安全追溯AI管理平台</div>
+    <div class="head_title" v-if="!iceRaftManage">智配送安全追溯AI管理平台</div>
+    <div class="head_title" v-else>智慧冰排管理系统</div>
     <!-- <i class="card_unpack" :class="iconFlag ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="getUnpack"></i> -->
     <div style="width: 1200px;flex: none;margin-left: 20px;">
       <el-menu mode="horizontal" :default-active="$route.path" class="el-menu-vertical-demo" router @open="handleOpen"
@@ -48,7 +49,15 @@
     },
     data() {
       return {
-
+        userInfo: {},
+        iceRaftManage: false,
+      }
+    },
+    mounted() {
+      var userInfo = localStorage.getItem('userList')
+      this.userInfo = JSON.parse(userInfo)
+      if (this.userInfo.dept) {
+        this.iceRaftManage = this.userInfo.dept.iceRaftManage
       }
     },
     methods: {

+ 108 - 14
src/views/incubator/IncubatorManagement.vue

@@ -15,7 +15,8 @@
     </div>
     <el-dialog :title="staffTitle" :visible.sync="staffDialogVisible" width="600px" :close-on-click-modal="false"
       @close="closeDialog">
-      <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" labelWidth="110px"></forms>
+      <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" labelWidth="110px"
+        @handleScroll="handleScroll" @remoteMethod="remoteMethod"></forms>
       <span slot="footer" class="dialog-footer" v-if="operationType != 'logs'">
         <el-button plain @click="staffDialogVisible = false">取 消</el-button>
         <el-button type="primary" :loading="confirmLoading" @click="handleAdd">确 定</el-button>
@@ -60,12 +61,15 @@
       </template>
       <thermography ref="thermo" :waybillNo="waybillNo" :timeData="timeQuantum"></thermography>
     </el-dialog>
-    <centerControl ref="control"></centerControl>
+    <!-- <centerControl ref="control"></centerControl> -->
   </div>
 </template>
 
 <script>
   import {
+    getIceRaft,
+  } from '@/api/freezer'
+  import {
     getCoolerBox,
     addCoolerBox,
     putCoolerBox,
@@ -81,7 +85,7 @@
   import pagination from '@/components/pagination'
   import forms from '@/components/forms'
   import thermography from '@/components/thermography'
-  import centerControl from '@/components/centerControl'
+  // import centerControl from '@/components/centerControl'
   import {
     formRules,
     employee,
@@ -100,7 +104,7 @@
       pagination,
       forms,
       thermography,
-      centerControl
+      // centerControl
     },
     data() {
       return {
@@ -254,6 +258,14 @@
           PageSize: 10,
         },
         userList: {},
+
+        icePagination: {
+          PageIndex: 1,
+          PageSize: 10,
+        },
+        iceTotal: 0,
+        staffName: '',
+        limitNo: true,
       }
     },
     beforeDestroy() {
@@ -271,9 +283,15 @@
       } else {
         const dataList = formRules();
         const tablearr = employee();
-        this.formRuleList = removePointById(dataList, ['cold_spots', 'cold_temperatures'])
-        this.stateRuleList = removePointById(this.stateRuleData, ['cold_spots', 'cold_temperatures'])
-        this.tableList = removePointById(tablearr, ['cold_spots', 'cold_temperatures'])
+        this.formRuleList = removePointById(dataList, ['cold_spots', 'iceBinding', 'for_cold_cooler_time',
+          'cold_temperatures'
+        ])
+        this.stateRuleList = removePointById(this.stateRuleData, ['cold_spots', 'iceBinding', 'for_cold_cooler_time',
+          'cold_temperatures'
+        ])
+        this.tableList = removePointById(tablearr, ['cold_spots', 'iceBinding', 'for_cold_cooler_time',
+          'cold_temperatures'
+        ])
       }
 
       function removePointById(arr1, arr2) {
@@ -369,6 +387,7 @@
             var params = {
               ...this.ruleForm
             }
+            params.for_cold_cooler_time = Number(this.ruleForm.for_cold_cooler_time)
             addCoolerBox(params).then(res => {
               if (res.code == 200) {
                 this.$message({
@@ -391,7 +410,9 @@
               status: this.ruleForm.status,
               cold_spots: this.ruleForm.cold_spots,
               cold_temperatures: this.ruleForm.cold_temperatures,
+              for_cold_cooler_time: Number(this.ruleForm.for_cold_cooler_time),
             }
+            console.log(params, 23)
             putCoolerBox(params).then(res => {
               if (res.code == 200) {
                 this.$message({
@@ -416,6 +437,9 @@
         if (type == 'edit') {
           this.staffTitle = '编辑'
           this.staffDialogVisible = true
+          if (this.userList.dept.isCoolerReleaseCold) {
+            this.obtainIceRaft()
+          }
           setTimeout(() => {
             this.$nextTick(() => {
               this.ruleForm = JSON.parse(JSON.stringify(row))
@@ -451,19 +475,89 @@
           this.staffTitle = '添加'
           this.staffDialogVisible = true
           this.operationType = type
+          if (this.userList.dept.isCoolerReleaseCold) {
+            this.obtainIceRaft()
+          }
         } else if (type == 'import') {
           this.importDialogVisible = true
           this.getDeviceList()
         } else if (type == 'screen') {
-          this.$refs.control.controlVisible = true
-          this.$nextTick(() => {
-            setTimeout(() => {
-              this.$refs.control.keyUpSearch()
-              this.$refs.control.getList()
-            }, 100)
-          })
+          // this.$refs.control.controlVisible = true
+          // this.$nextTick(() => {
+          //   setTimeout(() => {
+          //     this.$refs.control.keyUpSearch()
+          //     this.$refs.control.getList()
+          //   }, 100)
+          // })
+        }
+      },
+      // 触底事件
+      handleScroll() {
+        if (this.limitNo) {
+          this.obtainIceRaft()
         }
       },
+      // 搜索
+      remoteMethod(value, type) {
+        this.resetSelect(type)
+        this.staffName = value
+        this.obtainIceRaft()
+      },
+      // 重置选择冰排
+      resetSelect(type) {
+        this.formRuleList.forEach(item => {
+          if (item.field == type) {
+            item.options = []
+          }
+        })
+        this.icePagination.PageIndex = 1
+        this.limitNo = true
+        this.staffName = ''
+      },
+      // 获取冰排列表
+      obtainIceRaft() {
+        var params = {
+          page: this.icePagination.PageIndex,
+          pageSize: 10,
+          code: this.staffName,
+        }
+        getIceRaft(params).then(res => {
+          if (res.code == 200) {
+            let arr = res.data.list
+            let arrList = []
+            arr.forEach(item1 => {
+              var arrData = {
+                label: null,
+                value: null,
+              }
+              arrData.label = item1.code
+              arrData.value = item1.code
+              // arrData.value = item1.id
+              arrList.push(arrData)
+            })
+            if (this.limitNo == true) {
+              this.formRuleList.forEach(item => {
+                if (item.field == 'iceBinding') {
+                  item.options = item.options.concat(arrList);
+                  let some = [];
+                  item.options.forEach(el => {
+                    if (!some.some(e => e.value == el.value)) {
+                      some.push(el)
+                    }
+                  })
+                  item.options = some
+                }
+              })
+            }
+            if (arrList.length >= 10) {
+              this.icePagination.PageIndex = ++this.icePagination.PageIndex;
+            } else {
+              // 已经没数据了 不需要增加数据
+              this.limitNo = false;
+            }
+          }
+        })
+      },
       // 获取设备列表
       getDeviceList() {
         var params = {

+ 36 - 5
src/views/incubator/incubator.js

@@ -34,7 +34,7 @@ export const employee = () => {
     label: '状态',
     align: 'center',
     options: startStatus()
-  },  {
+  }, {
     field: 'monitorStatus',
     label: '监控状态',
     align: 'center',
@@ -48,6 +48,10 @@ export const employee = () => {
     label: '预冷地点',
     align: 'center',
   }, {
+    field: 'for_cold_cooler_time',
+    label: '预冷要求',
+    align: 'center',
+  }, {
     field: 'deviceData.T_t',
     label: '最新温度',
     align: 'center',
@@ -107,29 +111,56 @@ export const formRules = () => {
       message: '请输入SN',
       trigger: 'blur'
     }]
-  },{
+  }, {
     field: 'cold_temperatures',
     label: '预冷温度(℃)',
     placeholder: '请输入预冷温度(℃)',
     type: 'input',
     colWidth: 24,
+    unit: '℃',
     rules: [{
-      required: true,
+      required: false,
       message: '请输入预冷温度(℃)',
       trigger: 'blur'
     }]
-  },{
+  }, {
     field: 'cold_spots',
     label: '预冷地点',
     placeholder: '请输入预冷地点',
     type: 'input',
     colWidth: 24,
     rules: [{
-      required: true,
+      required: false,
       message: '请输入预冷地点',
       trigger: 'blur'
     }]
   }, {
+    field: 'for_cold_cooler_time',
+    label: '预冷要求',
+    placeholder: '请输入预冷要求',
+    type: 'input',
+    colWidth: 24,
+    unit: '小时',
+    rules: [{
+      required: false,
+      message: '请输入预冷要求',
+      trigger: 'blur'
+    }, {
+      required: false,
+      validator: (rule, value, callback) => {
+        if (!value && rule.required) {
+          return callback(new Error('请输入预冷要求'));
+        }
+        if (value) {
+          if (!/^(\d+)?(\.\d+)?$/.test(value)) {
+            return callback(new Error('请输入有效的数值'));
+          }
+        }
+        return callback();
+      },
+      trigger: ['blur', 'change']
+    }]
+  }, {
     field: 'status',
     label: '状态',
     placeholder: '状态',

+ 17 - 5
src/views/incubator/retrospect.js

@@ -11,7 +11,7 @@ export const employee = () => {
     field: 'sn',
     label: 'SN',
     align: 'center',
-  },{
+  }, {
     field: 'coolerBoxStarTime',
     label: '预冷放入时间',
     align: 'center',
@@ -20,6 +20,14 @@ export const employee = () => {
     label: '预冷温度',
     align: 'center',
   }, {
+    field: 'for_cold_duration',
+    label: '预冷时间',
+    align: 'center',
+  }, {
+    field: 'for_cold_cooler_time',
+    label: '预冷要求',
+    align: 'center',
+  }, {
     field: 'cooler-cold-address',
     label: '预冷地点',
     align: 'center',
@@ -27,19 +35,23 @@ export const employee = () => {
     field: 'cooler-cold-users',
     label: '预冷操作人',
     align: 'center',
-  },  {
+  }, {
     field: 'coolerBoxUserTime',
     label: '使用时间',
     align: 'center',
-  },  {
+  }, {
     field: 'historyCode',
     label: '放置冰排编号',
     align: 'center',
-  },  {
+  }, {
     field: 'historyCodeNum',
     label: '放置冰排数量',
     align: 'center',
-  },  {
+  }, {
+    field: 'coolerBoxUserTime',
+    label: '归还时间',
+    align: 'center',
+  }, {
     field: 'cooler-use-users',
     label: '使用人员',
     align: 'center',

+ 129 - 45
src/views/page/incubatorView.vue

@@ -26,8 +26,8 @@
           </div>
         </div>
         <div class="history_warp" v-loading="tableLoading">
-          <el-table ref="multipleTable" label-position="center" :data="tableData"
-            :highlight-current-row="currentId == 2 ? true : false" height="calc(100% - 51px)" border style="width: 100%"
+          <el-table class="top" label-position="center" :data="tableData"
+            :highlight-current-row="currentId == 2 ? true : false" border style="width: 100%"
             @selection-change="handleSelectionChange" @cell-click="selectIncubator"
             :row-key="(row) => { return row.id }" :key="currentId">
             <el-table-column reserve-selection type="selection" width="55" v-if="currentId == 1"></el-table-column>
@@ -35,27 +35,47 @@
             <el-table-column prop="name" width="220" label="名称"></el-table-column>
             <el-table-column prop="sn" width="180" label="SN"></el-table-column>
             <el-table-column prop="status" align="center" width="70" label="状态">
-              <template slot-scope="scope">
-                <div :style="{color: filterColor(scope.row,startStatus,'status')}">
-                  {{initDictvalueil(scope.row,startStatus,'status')}}
-                </div>
-              </template>
             </el-table-column>
             <el-table-column prop="monitorStatus" align="center" width="80" label="监控状态">
-              <template slot-scope="scope">
-                <div :style="{color: filterColor(scope.row,deviceState,'monitorStatus')}">
-                  {{initDictvalueil(scope.row,deviceState,'monitorStatus')}}
-                </div>
-              </template>
             </el-table-column>
             <el-table-column prop="deviceData.address" label="当前地址"></el-table-column>
             <el-table-column prop="deviceData.T_t" align="center" width="80" label="最新温度">
-              <template slot-scope="scope">
-                <div>{{scope.row.deviceData.T_t || ''}}</div>
-              </template>
             </el-table-column>
             <el-table-column prop="deviceData.T_time" width="180" label="最新记录时间"></el-table-column>
           </el-table>
+          <vue-seamless-scroll style="height: calc(100% - 100px);overflow: hidden;" ref="vueSeamlessScroll"
+            :data="tableData" :class-option="classOption" @mousewheel.native="handleScroll" v-if="updataFlag">
+            <el-table class="bottom" ref="multipleTable" label-position="center" :data="tableData"
+              :highlight-current-row="currentId == 2 ? true : false" border style="width: 100%"
+              @selection-change="handleSelectionChange" @cell-click="selectIncubator"
+              :row-key="(row) => { return row.id }" :key="currentId">
+              <el-table-column reserve-selection type="selection" width="55" v-if="currentId == 1"></el-table-column>
+              <el-table-column type="index" width="50" v-else></el-table-column>
+              <el-table-column prop="name" width="220" label="名称"></el-table-column>
+              <el-table-column prop="sn" width="180" label="SN"></el-table-column>
+              <el-table-column prop="status" align="center" width="70" label="状态">
+                <template slot-scope="scope">
+                  <div :style="{color: filterColor(scope.row,startStatus,'status')}">
+                    {{initDictvalueil(scope.row,startStatus,'status')}}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="monitorStatus" align="center" width="80" label="监控状态">
+                <template slot-scope="scope">
+                  <div :style="{color: filterColor(scope.row,deviceState,'monitorStatus')}">
+                    {{initDictvalueil(scope.row,deviceState,'monitorStatus')}}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="deviceData.address" label="当前地址"></el-table-column>
+              <el-table-column prop="deviceData.T_t" align="center" width="80" label="最新温度">
+                <template slot-scope="scope">
+                  <div>{{scope.row.deviceData.T_t || ''}}</div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="deviceData.T_time" width="180" label="最新记录时间"></el-table-column>
+            </el-table>
+          </vue-seamless-scroll>
           <div v-if="Total">
             <pagination :total="Total" :currentPage="Pagination.PageIndex" layout="total, prev, pager, next,jumper"
               @changeSize="changeSize" @changeCurrent="changeCurrent">
@@ -93,6 +113,7 @@
 </template>
 
 <script>
+  import vueSeamlessScroll from "vue-seamless-scroll";
   import {
     getCoolerBox,
     getCoolerBoxLocus,
@@ -108,6 +129,7 @@
   export default {
     name: 'IncubatorTable',
     components: {
+      vueSeamlessScroll,
       pagination,
     },
     data() {
@@ -161,9 +183,23 @@
         asyncDataLoaded: false,
         limitNoil: true,
         timePage: 1,
-        colorIndex: 0,
+        updataFlag: false,
       }
     },
+    computed: {
+      classOption() {
+        return {
+          step: 0.2, // 数值越大速度滚动越快
+          limitMoveNum: 10, // 开始无缝滚动的数据量
+          hoverStop: true, // 是否开启鼠标悬停stop
+          direction: 1, // 0向下 1向上 2向左 3向右
+          openWatch: true, // 开启数据实时监控刷新dom
+          singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
+          singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
+          waitTime: 500, // 单步运动停止的时间(默认值1000ms)
+        };
+      },
+    },
     // 页面销毁
     beforeDestroy() {
       if (this.jointSn.length > 0) {
@@ -222,6 +258,7 @@
             })
             this.tableData = res.data.list
             this.Total = res.data.count
+            this.updataFlag = true
             this.$forceUpdate()
           }
           this.tableLoading = false
@@ -229,6 +266,22 @@
           this.tableLoading = false
         })
       },
+      // 滚动代码
+      handleScroll(e) {
+        // 改变组件内部 yPos 的值,这样html的translate(0, yPos)就会随之改变
+        // e.deltaY是滚动的距离
+        this.$refs.vueSeamlessScroll.yPos = this.$refs.vueSeamlessScroll.yPos - e.deltaY
+        // 如果是正数 说明是往上滚
+        if (this.$refs.vueSeamlessScroll.yPos > 0) {
+          this.$refs.vueSeamlessScroll.yPos = 0
+          return
+        }
+        // 如果yPos超过内部实际高度的一半则重新到顶部滚动
+        // 一半的原因是因为组件实际上创建了两个dom,以达到无缝衔接的效果
+        if (Math.abs(this.$refs.vueSeamlessScroll.yPos) > this.$refs.vueSeamlessScroll.realBoxHeight / 2) {
+          this.$refs.vueSeamlessScroll.yPos = 0
+        }
+      },
       // 更新保温箱实时数据
       refreshData(event, soleSn) {
         this.tableData.map(async item => {
@@ -260,6 +313,7 @@
             item.flag = true
             this.Pagination.PageIndex = 1
             this.Pagination.PageSize = 10
+            this.updataFlag = false
             this.getList()
           } else {
             item.flag = false
@@ -349,7 +403,7 @@
         })
         const userData = localStorage.getItem('userList')
         const deptId = JSON.parse(userData)
-        that.map.setFitView(null, false, [150, 60, 100, 60])
+        that.map.setFitView(null, false, [20, 30, 100, 30])
         if (event == true) {
           return
         }
@@ -360,7 +414,7 @@
             that.mapLoading = true
             const T_sn = uniqueToFirstArray[i].sn
             const CoolerName = uniqueToFirstArray[i].name
-            await that.getDeviceAttachment(T_sn, CoolerName, deptId)
+            await that.getDeviceAttachment(T_sn, CoolerName, deptId, i)
             that.mapLoading = false
           }
         } else {
@@ -371,14 +425,17 @@
         }
       },
       // sse连接保温箱设备
-      getDeviceAttachment(T_sn, CoolerName, deptId) {
+      getDeviceAttachment(T_sn, CoolerName, deptId, index) {
         return new Promise((resolve, inject) => {
           const that = this
           // that.eventSource[T_sn] = new EventSource(
           //   `http://182.43.247.65:6280/api/waybill/newlocus?T_sn=${T_sn}&Id=${deptId.dept.id}&CoolerName=${CoolerName}`
           // ); //测试
+          // that.eventSource[T_sn] = new EventSource(
+          //   `https://colddelivery.coldbaozhida.com/cold_delivery/api/waybill/newlocus?T_sn=${T_sn}&Id=${deptId.dept.id}&CoolerName=${CoolerName}`
+          // ); //正式
           that.eventSource[T_sn] = new EventSource(
-            `https://colddelivery.coldbaozhida.com/cold_delivery/api/waybill/newlocus?T_sn=${T_sn}&Id=${deptId.dept.id}&CoolerName=${CoolerName}`
+            `${process.env.VUE_APP_BASE_API}/api/waybill/newlocus?T_sn=${T_sn}&Id=${deptId.dept.id}&CoolerName=${CoolerName}`
           ); //正式
           that.eventSource[T_sn].onopen = function(e) {
             // console.log('Connection to SSE opened.', e);
@@ -390,7 +447,7 @@
             // console.log('Message from SSE stream:', arr);
             if (arr.data) {
               if (arr.code == 200) {
-                that.initMarker(arr.data[0], arr)
+                that.initMarker(arr.data[0], arr, index)
                 // 更新数据
                 that.refreshData(arr.data[0], arr.sn)
               } else {
@@ -417,13 +474,16 @@
         })
       },
       // 初始化坐标点的icon
-      initMarker(location, information) {
+      initMarker(location, information, index) {
         let that = this
         let latitude = location.T_site.split(',')
         let dataList = information.data
         var trackList = []
         var correctionTrajectory = []
         var positions = information.data
+        var truckUrl = ['0070ff', 'E6A23C', '67C23A', 'f9ff00', 'd4237a', '17abe3', 'a4579d', '00fdff', '9f00ff',
+          'ff0000'
+        ]
         if (positions.length > 0) {
           positions.forEach(item => {
             if (item.T_site != '0,0' && item.T_site) {
@@ -450,14 +510,14 @@
           if (that.carMarker[information.sn].marker) {
             that.carMarker[information.sn].marker.setMap(null)
             let icon = new AMap.Icon({
-              size: new AMap.Size(40, 45),
-              image: require(`@/assets/images/truck.png`),
-              imageSize: new AMap.Size(40, 45),
+              size: new AMap.Size(50, 40),
+              image: require(`@/assets/vehicle/${truckUrl[index]}.png`),
+              imageSize: new AMap.Size(50, 40),
             });
             that.carMarker[information.sn].marker = new AMap.Marker({
               icon: icon, // 坐标点图标
               position: [Number(latitude[0]), Number(latitude[1])], // 左边点的经纬度
-              offset: new AMap.Pixel(-10, -30) // 坐标点偏移量
+              offset: new AMap.Pixel(-20, -15) // 坐标点偏移量
             });
             var geocoder = new AMap.Geocoder({
               city: "010", //城市设为北京,默认:“全国”
@@ -470,11 +530,11 @@
                 var markerContent = '' +
                   '<div class="incubator_card_map">' +
                   '   <div class="map_title_incu">' + information.CoolerName + '</div>' +
-                  '   <div class="map_title_incu1">' + information.sn + '</div>' +
+                  '   <div class="map_content"><div class="map_title_incu1">' + information.sn + '</div>' +
                   '   <div class="map_title_incu1">最新温度: <span>' + location.T_t + '</span></div>' +
                   '   <div class="map_title_incu2">记录时间: ' + location.T_time + '</div>' +
-                  '   <div class="map_title_incu2">当前地址: ' + address + '</div>' +
-                  '   <div class="map_arrows"></div>' +
+                  '   <div class="map_title_incu3">当前地址: ' + address + '</div>' +
+                  '   </div><div class="map_arrows"></div>' +
                   '</div>';
                 that.carMarker[information.sn].marker.setLabel({
                   offset: new AMap.Pixel(-3, -68),
@@ -499,9 +559,9 @@
             imageOffset: new AMap.Pixel(-9, -3)
           });
           let icon = new AMap.Icon({
-            size: new AMap.Size(40, 45),
-            image: require(`@/assets/images/truck.png`),
-            imageSize: new AMap.Size(40, 45),
+            size: new AMap.Size(50, 40),
+            image: require(`@/assets/vehicle/${truckUrl[index]}.png`),
+            imageSize: new AMap.Size(50, 40),
           });
           that.carMarker[information.sn] = {
             marker: null,
@@ -512,7 +572,7 @@
           that.carMarker[information.sn].marker = new AMap.Marker({
             icon: icon, // 坐标点图标
             position: [Number(latitude[0]), Number(latitude[1])], // 左边点的经纬度
-            offset: new AMap.Pixel(-10, -30) // 坐标点偏移量
+            offset: new AMap.Pixel(-20, -15) // 坐标点偏移量
           });
           // 起点
           var startArr = positions[positions.length - 1].T_site.split(',')
@@ -533,11 +593,11 @@
               var markerContent = '' +
                 '<div class="incubator_card_map">' +
                 '   <div class="map_title_incu">' + information.CoolerName + '</div>' +
-                '   <div class="map_title_incu1">' + information.sn + '</div>' +
+                '   <div class="map_content"><div class="map_title_incu1">' + information.sn + '</div>' +
                 '   <div class="map_title_incu1">最新温度: <span>' + location.T_t + '</span></div>' +
                 '   <div class="map_title_incu2">记录时间: ' + location.T_time + '</div>' +
-                '   <div class="map_title_incu2">当前地址: ' + address + '</div>' +
-                '   <div class="map_arrows"></div>' +
+                '   <div class="map_title_incu3">当前地址: ' + address + '</div>' +
+                '   </div><div class="map_arrows"></div>' +
                 '</div>';
               that.carMarker[information.sn].marker.setLabel({
                 offset: new AMap.Pixel(-3, -68),
@@ -545,22 +605,21 @@
                 direction: 'center',
               })
               that.carMarker[information.sn].marker.setMap(that.map)
-              let colorArr = ['#0070ff', '#E6A23C', '#67C23A', '#f9ff00', '#8fff00', '#a0cfff', '#00ff16',
+              let colorArr = ['#0070ff', '#E6A23C', '#67C23A', '#f9ff00', '#d4237a', '#17abe3', '#a4579d',
                 '#00fdff', '#9f00ff', '#ff0000',
               ]
               that.carMarker[information.sn].polyline = new AMap.Polyline({
                 map: that.map,
                 path: trackList,
                 showDir: true,
-                strokeColor: colorArr[that.colorIndex], //线颜色
+                strokeColor: colorArr[index], //线颜色
                 strokeWeight: 10, //线宽
                 strokeStyle: "solid",
                 lineJoin: 'round',
                 lineCap: 'round',
               });
-              that.colorIndex++
               that.carMarker[information.sn].polyline.setMap(that.map)
-              that.map.setFitView(null, false, [150, 60, 100, 60])
+              that.map.setFitView(null, false, [20, 30, 100, 30])
               // var graspRoad;
               // if (!graspRoad) {
               //   graspRoad = new AMap.GraspRoad()
@@ -590,7 +649,7 @@
             }
           });
         }
-        that.map.setFitView(null, false, [150, 60, 100, 60])
+        that.map.setFitView(null, false, [20, 30, 100, 30])
       },
       keyUpSearch() {
         var that = this
@@ -751,7 +810,7 @@
           }
           var truckIcon = new AMap.Icon({
             size: new AMap.Size(40, 45),
-            image: require(`@/assets/images/truck.png`),
+            image: require(`@/assets/vehicle/67C23A.png`),
             imageSize: new AMap.Size(40, 45),
           });
           that.marker = new AMap.Marker({
@@ -989,6 +1048,14 @@
     overflow: hidden;
   }
 
+  ::v-deep .top .el-table__body-wrapper {
+    display: none;
+  }
+
+  ::v-deep .bottom .el-table__header-wrapper {
+    display: none;
+  }
+
   .history_warp ::v-deep .el-table {
     color: #606266;
   }
@@ -1096,11 +1163,14 @@
 
   ::v-deep .incubator_card_map {
     position: relative;
-    width: 190px;
+    // width: 190px;
+    width: fit-content;
+    width: -webkit-fit-content;
+    width: -moz-fit-content;
     background-color: #fff;
     border: 1px solid #DCDFE6;
     padding: 5px;
-    border-radius: 8px;
+    border-radius: 4px;
     // overflow: hidden;
   }
 
@@ -1110,6 +1180,12 @@
     margin-bottom: 4px;
   }
 
+  ::v-deep .map_content {
+    display: flex;
+    // display: none;
+    flex-direction: column;
+  }
+
   ::v-deep .map_title_incu1 {
     font-size: 14px;
 
@@ -1123,12 +1199,20 @@
     white-space: normal;
     font-size: 12px;
     margin: 2px 0px;
+    min-width: 180px;
+  }
+
+  ::v-deep .map_title_incu3 {
+    font-size: 12px;
+    margin: 2px 0px;
+    overflow-wrap: break-word;
+    white-space: pre-wrap;
   }
 
   ::v-deep .map_arrows {
     position: absolute;
     bottom: 0px;
-    left: 90px;
+    left: calc(50% - 5px);
   }
 
   ::v-deep .map_arrows::before {

+ 14 - 1
src/views/system/CompanyManagement.vue

@@ -78,11 +78,13 @@
         formRuleList: [],
         ruleForm: {
           name: '',
+          appName: '',
           companyAddress: '',
           coldKey: '',
           isIceReleaseCold: false,
           isCoolerReleaseCold: false,
           isOutStorage: false,
+          iceRaftManage: false,
           remark: '',
         },
         confirmLoading: false,
@@ -147,12 +149,14 @@
             var params = {
               id: this.ruleForm.id,
               name: this.ruleForm.name,
+              appName: this.ruleForm.appName,
               remark: this.ruleForm.remark,
               coldKey: this.ruleForm.coldKey,
               companyAddress: this.ruleForm.companyAddress,
               isIceReleaseCold: this.ruleForm.isIceReleaseCold,
               isCoolerReleaseCold: this.ruleForm.isCoolerReleaseCold,
               isOutStorage: this.ruleForm.isOutStorage,
+              iceRaftManage: this.ruleForm.iceRaftManage,
             }
             putCompany(params).then(res => {
               if (res.code == 200) {
@@ -225,7 +229,16 @@
       },
       // 清空表单
       closeDialog() {
-        this.ruleForm = {}
+        // this.ruleForm = {}
+        this.ruleForm.name = ''
+        this.ruleForm.appName = ''
+        this.ruleForm.companyAddress = ''
+        this.ruleForm.coldKey = ''
+        this.ruleForm.isIceReleaseCold = false
+        this.ruleForm.isCoolerReleaseCold = false
+        this.ruleForm.isOutStorage = false
+        this.ruleForm.iceRaftManage = false
+        this.ruleForm.remark = ''
         this.$refs.childRules.resetCheck();
       }
     }

+ 41 - 29
src/views/system/company.js

@@ -7,6 +7,10 @@ export const employee = () => {
       label: '名称',
       align: 'left',
     }, {
+      field: 'appName',
+      label: 'APP公司名称',
+      align: 'center',
+    }, {
       field: 'companyAddress',
       label: '地址',
       align: 'center',
@@ -37,20 +41,6 @@ export const employee = () => {
         bgcolor: '#F56C6C',
       }]
     },
-    // {
-    //   field: 'isCoolerReleaseCold',
-    //   label: '温湿度起讫时间',
-    //   align: 'center',
-    //   options: [{
-    //     label: '已开启',
-    //     value: true,
-    //     bgcolor: '#67C23A',
-    //   }, {
-    //     label: '已关闭',
-    //     value: false,
-    //     bgcolor: '#F56C6C',
-    //   }]
-    // },
     {
       field: 'isOutStorage',
       label: '冷冻要求验证',
@@ -65,6 +55,19 @@ export const employee = () => {
         bgcolor: '#F56C6C',
       }]
     }, {
+      field: 'iceRaftManage',
+      label: '冰排管理权限',
+      align: 'center',
+      options: [{
+        label: '已开启',
+        value: true,
+        bgcolor: '#67C23A',
+      }, {
+        label: '已关闭',
+        value: false,
+        bgcolor: '#F56C6C',
+      }]
+    }, {
       field: 'remark',
       label: '备注',
       align: 'center',
@@ -106,6 +109,17 @@ export const formRules = () => {
       trigger: 'blur'
     }]
   }, {
+    field: 'appName',
+    label: 'app公司名称',
+    placeholder: '请输入app公司名称',
+    type: 'input',
+    colWidth: 24,
+    rules: [{
+      required: false,
+      message: '请输入app公司名称',
+      trigger: 'blur'
+    }]
+  }, {
     field: 'companyAddress',
     label: '地址',
     placeholder: '请输入地址',
@@ -149,25 +163,12 @@ export const formRules = () => {
       message: '请选择是否开启保温箱预冷',
       trigger: 'blur'
     }]
-  },
-  // {
-  //   field: 'isCoolerReleaseCold',
-  //   label: '温湿度起讫时间',
-  //   placeholder: '请选择是否开启温湿度起讫时间',
-  //   type: 'switch',
-  //   colWidth: 8,
-  //   rules: [{
-  //     required: true,
-  //     message: '请选择是否开启温湿度起讫时间',
-  //     trigger: 'blur'
-  //   }]
-  // },
-  {
+  }, {
     field: 'isOutStorage',
     label: '冷冻要求验证',
     placeholder: '冷冻要求验证',
     type: 'switch',
-    labelWidth:'170px',
+    labelWidth: '170px',
     colWidth: 10,
     rules: [{
       required: true,
@@ -175,6 +176,17 @@ export const formRules = () => {
       trigger: 'blur'
     }]
   }, {
+    field: 'iceRaftManage',
+    label: '冰排管理权限',
+    placeholder: '请选择是否开启冰排管理权限',
+    type: 'switch',
+    colWidth: 24,
+    rules: [{
+      required: true,
+      message: '请选择是否开启冰排管理权限',
+      trigger: 'blur'
+    }]
+  }, {
     field: 'remark',
     label: '备注',
     placeholder: '请输入备注',

+ 2 - 1
vue.config.js

@@ -16,9 +16,10 @@ module.exports = defineConfig({
   devServer: {
     proxy: {
       '/api': {
+        // target: process.env.VUE_APP_BASE_API,
         // target: 'https://colddelivery.coldbaozhida.com/cold_delivery',
         target: 'http://colddeliverytest.coldbaozhida.com:9090/cold_delivery', //测试
-        // target: 'http://192.168.11.15:6280', //本地
+        // target: 'http://192.168.11.49:6280', //本地
         ws: false,
         changeOrigin: true,
         pathRewrite: {

+ 12 - 0
yarn.lock

@@ -2626,6 +2626,11 @@ compression@^1.7.4:
     safe-buffer "5.1.2"
     vary "~1.1.2"
 
+comutils@^1.1.9:
+  version "1.1.19"
+  resolved "https://registry.npmmirror.com/comutils/-/comutils-1.1.19.tgz"
+  integrity sha512-JxXB67juILiwhdLwOsYyjUqwWEhHdObI0EClOPk+JDtEuTbac59s0pxGpfCBnNNQ5JommifmcMGneW/4Cg7YWw==
+
 concat-map@0.0.1:
   version "0.0.1"
   resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
@@ -6917,6 +6922,13 @@ vue-router@^3.5.1:
   resolved "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz"
   integrity sha512-VYXZQLtjuvKxxcshuRAwjHnciqZVoXAjTjcqBTz4rKc8qih9g9pI3hbDjmqXaHdgL3v8pV6P8Z335XvHzESxLQ==
 
+vue-seamless-scroll@^1.1.23:
+  version "1.1.23"
+  resolved "https://registry.npmmirror.com/vue-seamless-scroll/-/vue-seamless-scroll-1.1.23.tgz"
+  integrity sha512-HBjUub8WwsKJzbFCrwKPDrZn4e+SSbkKgwWtjKtfLwesiFGwSsVxP44/Z6d3kpXy94qIFOiflJH6l0/9pj7SGA==
+  dependencies:
+    comutils "^1.1.9"
+
 vue-style-loader@^4.1.0, vue-style-loader@^4.1.3:
   version "4.1.3"
   resolved "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz"