作者 朱兆平

Merge remote-tracking branch 'origin/master_dev'

  1 +import axios from 'axios'
  2 +import http from "../http";
  3 +
  4 +let baseServiceURL = 'wms-server-warehouse'
  5 +
  6 +export const selectVehicle = params => { return axios.get(`${baseServiceURL}/map/location/lastlocation`, { params: params }); };
@@ -19,7 +19,10 @@ import Print from 'vue-print-nb' @@ -19,7 +19,10 @@ import Print from 'vue-print-nb'
19 // 条形组件 19 // 条形组件
20 import VueBarcode from '@xkeshi/vue-barcode'; //导入条形码插件 20 import VueBarcode from '@xkeshi/vue-barcode'; //导入条形码插件
21 Vue.component('barcode', VueBarcode); 21 Vue.component('barcode', VueBarcode);
22 - 22 +import BaiduMap from 'vue-baidu-map'
  23 +Vue.use(BaiduMap, {
  24 + ak: 'PV0SfW0yRxe4NHUQ8OhyO4DrDbiwX4Sd'
  25 +})
23 26
24 //定义一个全局过滤器实现日期格式化 27 //定义一个全局过滤器实现日期格式化
25 Vue.filter('datefmt',function(input,fmtstring){ 28 Vue.filter('datefmt',function(input,fmtstring){
@@ -43,6 +46,7 @@ Vue.use(ElementUI, @@ -43,6 +46,7 @@ Vue.use(ElementUI,
43 Vue.use(VueRouter) 46 Vue.use(VueRouter)
44 Vue.use(Vuex) 47 Vue.use(Vuex)
45 Vue.use(Print) 48 Vue.use(Print)
  49 +
46 Vue.prototype.$axios = axios; 50 Vue.prototype.$axios = axios;
47 51
48 //NProgress.configure({ showSpinner: false }); 52 //NProgress.configure({ showSpinner: false });
@@ -110,6 +110,7 @@ import myTask from './views/technological/myTask.vue' @@ -110,6 +110,7 @@ import myTask from './views/technological/myTask.vue'
110 import definition from './views/technological/definition.vue' 110 import definition from './views/technological/definition.vue'
111 111
112 //仓库场站管理 112 //仓库场站管理
  113 +import vehicle from './views/deploy/vehicle.vue'
113 import station from './views/deploy/station.vue' 114 import station from './views/deploy/station.vue'
114 import house from './views/deploy/house.vue' 115 import house from './views/deploy/house.vue'
115 import inventroyrecord from './views/deploy/inventroyrecord.vue' 116 import inventroyrecord from './views/deploy/inventroyrecord.vue'
@@ -562,6 +563,7 @@ let routes = [ @@ -562,6 +563,7 @@ let routes = [
562 name: '仓库场站管理', 563 name: '仓库场站管理',
563 iconCls:'el-icon-goods', 564 iconCls:'el-icon-goods',
564 children:[ 565 children:[
  566 + {path:'/vehicle',component:vehicle,name:'车辆定位'},
565 {path:'/station',component:station,name:'场站管理'}, 567 {path:'/station',component:station,name:'场站管理'},
566 {path:'/house',component:house,name:'仓库管理'}, 568 {path:'/house',component:house,name:'仓库管理'},
567 {path:'/inventroyrecord',component:inventroyrecord,name:'库存变更记录'}, 569 {path:'/inventroyrecord',component:inventroyrecord,name:'库存变更记录'},
  1 +<template>
  2 + <div>
  3 + <el-row>
  4 + <el-card style="background-color: #F5F7FA">
  5 + <el-row>
  6 + <el-col :span="5">
  7 + <el-input v-model="queryInfo.vno" prefix-icon="el-icon-search" size="small" style="width: 200px"
  8 + placeholder="车牌号" clearable>
  9 + <template slot="prepend">车牌号</template>
  10 + </el-input>
  11 + </el-col>
  12 + <el-col :offset="1" :span="12">
  13 + <div class="my-text-area">
  14 + <div class="el-input-group__prepend prepand">车牌类型</div>
  15 + <el-select v-model="queryInfo.vnocolor" placeholder="车牌类型" style="width: 200px" clearable>
  16 + <el-option label="蓝色" value="1"></el-option>
  17 + <el-option label="黄色" value="2"></el-option>
  18 + <el-option label="绿色" value="3"></el-option>
  19 + </el-select>
  20 + </div>
  21 + </el-col>
  22 + <el-col :span="3">
  23 + <el-button type="primary" icon="el-icon-search" size="small" @click="getList()">
  24 + 查询
  25 + </el-button>
  26 + </el-col>
  27 + </el-row>
  28 +
  29 + </el-card>
  30 + </el-row>
  31 + <div id="mapContainer" style="width: 100%; height: 500px;"></div>
  32 + </div>
  33 +</template>
  34 +<script>
  35 + import AMapLoader from '@amap/amap-jsapi-loader';
  36 + import { selectVehicle } from '../../api/consigner/vehicle';
  37 +
  38 + export default {
  39 + name: 'MapComponent',
  40 + data() {
  41 + return {
  42 + mapInstance: null,
  43 + queryInfo: {
  44 + vno: '',
  45 + vnocolor: ''
  46 + }
  47 + };
  48 + },
  49 + methods: {
  50 + getList() {
  51 + const _this = this;
  52 + selectVehicle(this.queryInfo).then((response) => {
  53 + const res = response.data;
  54 + if (res.code !== '200') {
  55 + return _this.$message.error('获取车辆位置失败!');
  56 + }
  57 + if(res.data.data!=='' && res.data.data!=null){
  58 + // 获取车辆位置信息
  59 + const vehicle = res.data.data.firstVcl;
  60 + // 在获取车辆位置成功的部分,创建信息窗口或者自定义标记
  61 + const markerContent = document.createElement('div');
  62 + markerContent.innerHTML = `
  63 + <div class="rounded-corner" STYLE="width: 200px;background-color: rgba(255,255,255,0.7);text-align: center">
  64 + <p>车牌号:${vehicle.vno}</p >
  65 + <p>已行驶距离:${vehicle.runDistance}公里</p >
  66 + <p>剩余距离:${vehicle.remainDistance}公里</p >
  67 + </div>
  68 + `;
  69 + if (vehicle.lon && vehicle.lat) {
  70 + const lon = parseFloat(vehicle.lon) / 600000.0; // 将经度字符串转换为数值并除以 600000.0
  71 + const lat = parseFloat(vehicle.lat) / 600000.0; // 将纬度字符串转换为数值并除以 600000.0
  72 + //const coords = wgs84togcj02(lon, lat);
  73 + // 添加车辆位置标记
  74 + const marker = new AMap.Marker({
  75 + position: [lon, lat],
  76 + map: _this.mapInstance,
  77 + content: markerContent
  78 + });
  79 + const defaultMarker = new AMap.Marker({
  80 + position: [lon, lat],
  81 + map: _this.mapInstance,
  82 + });
  83 + // 移动地图中心到车辆位置
  84 + _this.mapInstance.setCenter([lon, lat]);
  85 + _this.$message.success('获取车辆位置成功!');
  86 + } else {
  87 + _this.$message.warning('车辆位置信息不完整!');
  88 + }
  89 + }else{
  90 + return _this.$message.error('无相关车辆信息返回');
  91 + }
  92 + }).catch(error => {
  93 + _this.$message.error('获取车辆位置失败:' + error.toString());
  94 + });
  95 + },
  96 + initMap() {
  97 + AMapLoader.load({
  98 + key: 'fdb27c13681d084e85ff8457b5cbe540',
  99 + version: '2.0',
  100 + plugins: [], // 可以加载地图插件,比如定位、地图工具等
  101 + }).then((AMap) => {
  102 + this.mapInstance = new AMap.Map('mapContainer', {
  103 + zoom: 10,
  104 + center: [116.397428, 39.90923], // 设置地图中心点
  105 + });
  106 + }).catch((err) => {
  107 + console.error(err);
  108 + });
  109 + },
  110 + },
  111 + mounted() {
  112 + this.initMap();
  113 + },
  114 + };
  115 +</script>
  116 +
  117 +<style scoped>
  118 + .my-text-area .prepand{
  119 + float: left;
  120 + width:89px;
  121 + height: 28px;
  122 + font-size: 12px;
  123 + line-height: 28px;
  124 + }
  125 +</style>
  126 +<style>
  127 + .my-text-area .el-textarea__inner{
  128 + min-height: 28px;
  129 + height: 28px;
  130 + border-bottom-left-radius: 0;
  131 + border-top-left-radius: 0;
  132 + }
  133 + .rounded-corner {
  134 + border-radius: 10px; /* 设置圆角的半径为10像素 */
  135 + background-color: #f0f0f0; /* 背景颜色 */
  136 + padding: 10px; /* 内边距 */
  137 + margin: 10px; /* 外边距 */
  138 + box-shadow: 0 0 5px #ddd; /* 盒子阴影效果 */
  139 + }
  140 +</style>
@@ -185,6 +185,11 @@ @@ -185,6 +185,11 @@
185 fixed="left" 185 fixed="left"
186 width="55" 186 width="55"
187 /> 187 />
  188 + <el-table-column label="总提运单号" width="140">
  189 + <template slot-scope="scope">
  190 + <a type="text" style="color: #409eff;text-decoration: underline" class="tableInline" @click="selectOne(scope.$index, scope.row)">{{ scope.row.billno }}</a>
  191 + </template>
  192 + </el-table-column>
188 <el-table-column label="统一编号" width="150"> 193 <el-table-column label="统一编号" width="150">
189 <template slot-scope="scope"> 194 <template slot-scope="scope">
190 <span>{{ scope.row.seqno }}</span> 195 <span>{{ scope.row.seqno }}</span>
@@ -204,21 +209,16 @@ @@ -204,21 +209,16 @@
204 <!--&lt;!&ndash; <span>{{ scope.row.trnmode }}</span>&ndash;&gt;--> 209 <!--&lt;!&ndash; <span>{{ scope.row.trnmode }}</span>&ndash;&gt;-->
205 <!-- </template>--> 210 <!-- </template>-->
206 <!-- </el-table-column>--> 211 <!-- </el-table-column>-->
207 - <el-table-column label="申报地海关" width="90">  
208 - <template slot-scope="scope">  
209 - <span>{{ scope.row.customscode }}</span>  
210 - </template>  
211 - </el-table-column> 212 +<!-- <el-table-column label="申报地海关" width="90">-->
  213 +<!-- <template slot-scope="scope">-->
  214 +<!-- <span>{{ scope.row.customscode }}</span>-->
  215 +<!-- </template>-->
  216 +<!-- </el-table-column>-->
212 <!-- <el-table-column label="集装箱(器)编号" width="140">--> 217 <!-- <el-table-column label="集装箱(器)编号" width="140">-->
213 <!-- <template slot-scope="scope">--> 218 <!-- <template slot-scope="scope">-->
214 <!-- <span>{{ scope.row.contaid }}</span>--> 219 <!-- <span>{{ scope.row.contaid }}</span>-->
215 <!-- </template>--> 220 <!-- </template>-->
216 <!-- </el-table-column>--> 221 <!-- </el-table-column>-->
217 - <el-table-column label="总提运单号" width="140">  
218 - <template slot-scope="scope">  
219 - <span>{{ scope.row.billno }}</span>  
220 - </template>  
221 - </el-table-column>  
222 <!-- <el-table-column label="进出境运输方式代码" width="120">--> 222 <!-- <el-table-column label="进出境运输方式代码" width="120">-->
223 <!-- <template slot-scope="scope">--> 223 <!-- <template slot-scope="scope">-->
224 <!-- <span v-if="scope.row.trafmode ==='2'">江海运输</span>--> 224 <!-- <span v-if="scope.row.trafmode ==='2'">江海运输</span>-->
@@ -239,16 +239,16 @@ @@ -239,16 +239,16 @@
239 <!-- <span>{{ scope.row.voyageno }}</span>--> 239 <!-- <span>{{ scope.row.voyageno }}</span>-->
240 <!-- </template>--> 240 <!-- </template>-->
241 <!-- </el-table-column>--> 241 <!-- </el-table-column>-->
242 - <el-table-column label="境内运输方式" width="120">  
243 - <template slot-scope="scope">  
244 - <span v-if="scope.row.trafway ==='2'">江海运输</span>  
245 - <span v-if="scope.row.trafway ==='3'">铁路运输</span>  
246 - <span v-if="scope.row.trafway ==='4'">汽车运输</span>  
247 - <span v-if="scope.row.trafway ==='5'">航空运输</span>  
248 - <span v-if="scope.row.trafway ==='6'">邮件运输</span>  
249 -<!-- <span>{{ scope.row.trafway }}</span>-->  
250 - </template>  
251 - </el-table-column> 242 +<!-- <el-table-column label="境内运输方式" width="120">-->
  243 +<!-- <template slot-scope="scope">-->
  244 +<!-- <span v-if="scope.row.trafway ==='2'">江海运输</span>-->
  245 +<!-- <span v-if="scope.row.trafway ==='3'">铁路运输</span>-->
  246 +<!-- <span v-if="scope.row.trafway ==='4'">汽车运输</span>-->
  247 +<!-- <span v-if="scope.row.trafway ==='5'">航空运输</span>-->
  248 +<!-- <span v-if="scope.row.trafway ==='6'">邮件运输</span>-->
  249 +<!--&lt;!&ndash; <span>{{ scope.row.trafway }}</span>&ndash;&gt;-->
  250 +<!-- </template>-->
  251 +<!-- </el-table-column>-->
252 <el-table-column label="托运货物件数" width="100"> 252 <el-table-column label="托运货物件数" width="100">
253 <template slot-scope="scope"> 253 <template slot-scope="scope">
254 <span>{{ scope.row.packno }}</span> 254 <span>{{ scope.row.packno }}</span>
@@ -259,11 +259,11 @@ @@ -259,11 +259,11 @@
259 <span>{{ scope.row.grosswt }}</span> 259 <span>{{ scope.row.grosswt }}</span>
260 </template> 260 </template>
261 </el-table-column> 261 </el-table-column>
262 - <el-table-column label="卸货地代码" width="120">  
263 - <template slot-scope="scope">  
264 - <span>{{ scope.row.unloadcode }}</span>  
265 - </template>  
266 - </el-table-column> 262 +<!-- <el-table-column label="卸货地代码" width="120">-->
  263 +<!-- <template slot-scope="scope">-->
  264 +<!-- <span>{{ scope.row.unloadcode }}</span>-->
  265 +<!-- </template>-->
  266 +<!-- </el-table-column>-->
267 <el-table-column label="时间" width="180"> 267 <el-table-column label="时间" width="180">
268 <template slot-scope="scope"> 268 <template slot-scope="scope">
269 <span>{{ scope.row.creattime }}</span> 269 <span>{{ scope.row.creattime }}</span>
@@ -368,9 +368,6 @@ @@ -368,9 +368,6 @@
368 </el-select> 368 </el-select>
369 </el-form-item> 369 </el-form-item>
370 </el-col> 370 </el-col>
371 -  
372 -  
373 -  
374 <!-- <el-col :span="6">--> 371 <!-- <el-col :span="6">-->
375 <!-- <el-form-item label="操作员卡号" prop="inputopid">--> 372 <!-- <el-form-item label="操作员卡号" prop="inputopid">-->
376 <!-- <el-input v-model="form.inputopid" placeholder="" />--> 373 <!-- <el-input v-model="form.inputopid" placeholder="" />-->
@@ -545,8 +542,8 @@ @@ -545,8 +542,8 @@
545 <el-row align="middle"> 542 <el-row align="middle">
546 <el-col :span="24" :offset="9"> 543 <el-col :span="24" :offset="9">
547 <el-form-item > 544 <el-form-item >
548 - <el-button style="width: 100px" type="info" @click="trn_dialog.addDialog = false">取消</el-button>  
549 - <el-button type="primary" style="width: 100px" @click="dialogStatus==='create'?trn_add():trn_edit()">提交</el-button> 545 + <el-button v-if="dialogStatus!=='find'" style="width: 100px" type="info" @click="trn_dialog.addDialog = false">取消</el-button>
  546 + <el-button v-if="dialogStatus!=='find'" type="primary" style="width: 100px" @click="dialogStatus==='create'?trn_add():trn_edit()">提交</el-button>
550 </el-form-item> 547 </el-form-item>
551 </el-col> 548 </el-col>
552 </el-row> 549 </el-row>
@@ -625,7 +622,8 @@ @@ -625,7 +622,8 @@
625 total: 0, 622 total: 0,
626 dialogMap: { 623 dialogMap: {
627 update: '编辑', 624 update: '编辑',
628 - create: '新增' 625 + create: '新增',
  626 + find: '查看',
629 }, 627 },
630 dialogStatus: 'create', 628 dialogStatus: 'create',
631 trn_dialog: { 629 trn_dialog: {
@@ -807,7 +805,7 @@ @@ -807,7 +805,7 @@
807 //编辑按钮使用权限 805 //编辑按钮使用权限
808 isButtonDisabled3(row) { 806 isButtonDisabled3(row) {
809 // 已申报或关务不能编辑 807 // 已申报或关务不能编辑
810 - if (row.dstatus ==='001' || this.names == true) { 808 + if (row.dstatus ==='001') {
811 return true; // 禁用按钮 809 return true; // 禁用按钮
812 } else { 810 } else {
813 return false; // 不禁用按钮 811 return false; // 不禁用按钮
@@ -825,7 +823,7 @@ @@ -825,7 +823,7 @@
825 //删除按钮使用权限 823 //删除按钮使用权限
826 isButtonDisabled5(row) { 824 isButtonDisabled5(row) {
827 // 已申报或关务不能删除 825 // 已申报或关务不能删除
828 - if (row.dstatus ==='001' || this.names == true) { 826 + if (row.dstatus ==='001') {
829 return true; // 禁用按钮 827 return true; // 禁用按钮
830 } else { 828 } else {
831 return false; // 不禁用按钮 829 return false; // 不禁用按钮
@@ -946,6 +944,13 @@ @@ -946,6 +944,13 @@
946 }) 944 })
947 }) 945 })
948 }, 946 },
  947 + // 查看
  948 + selectOne(index, row){
  949 + this.form = Object.assign({}, row)
  950 + this.trn_dialog.addDialog = true
  951 + this.dialogStatus = 'find'
  952 +
  953 + },
949 // 打开编辑 954 // 打开编辑
950 editTrn(index, row) { 955 editTrn(index, row) {
951 this.form = Object.assign({}, row) 956 this.form = Object.assign({}, row)