Forráskód Böngészése

2024年5月6日17:35:13

纪新园 1 éve
szülő
commit
29f24f24b9

+ 37 - 196
src/views/wel/home/landTransportation/components/sales-trend.vue

@@ -16,17 +16,13 @@
                         <template slot="addressDetail" slot-scope="{ row,index}">
                             <el-tooltip class="item" effect="dark" placement="top">
                                 <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
-                                <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
-                                    {{ row.addressDetail }}
-                                </div>
+                                <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.addressDetail }}</div>
                             </el-tooltip>
                         </template>
                         <template slot="unloadingPlace" slot-scope="{ row,index}">
                             <el-tooltip class="item" effect="dark" placement="top">
                                 <div v-html="ToBreak(row.unloadingPlace)" slot="content"></div>
-                                <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
-                                    {{ row.unloadingPlace }}
-                                </div>
+                                <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.unloadingPlace }}</div>
                             </el-tooltip>
                         </template>
                         <template slot="plateNo" slot-scope="{row}">
@@ -38,9 +34,7 @@
                       @click="openTrackTwo(row,0)">{{ row.dispatchNumber }}</span>
                         </template>
                         <template slot="menuLeft">
-                            <span @click="getsalesTrend({status: 0, mold:mold})">今日业务详情{{
-                                    mold == 1 ? '(集装箱)' : mold == 2 ? '(散货)' : mold == 3 ? '(特种)' : ''
-                                }}</span>
+                            <span @click="getsalesTrend({status: 0, mold:mold})">今日业务详情{{ mold == 1 ? '(集装箱)' : mold == 2 ? '(散货)' : mold == 3 ? '(特种)' : '' }}</span>
                         </template>
                         <template slot="status" slot-scope="{row}">
                             <span v-if="row.status == 0" style="color: #3C9CFF;">未提交</span>
@@ -57,9 +51,7 @@
                                @resetColumn="resetColumn"
                                @saveColumn="saveColumn">
                         <template slot="menuLeft">
-                            <span @click="getsalesTrend({status: 0, mold: mold})">今日业务详情{{
-                                    mold == 1 ? '(集装箱)' : mold == 2 ? '(散货)' : mold == 3 ? '(特种)' : ''
-                                }}</span>
+                            <span @click="getsalesTrend({status: 0, mold: mold})">今日业务详情{{ mold == 1 ? '(集装箱)' : mold == 2 ? '(散货)' : mold == 3 ? '(特种)' : '' }}</span>
                         </template>
                         <template slot="billNo" slot-scope="{row}">
                 <span class="el-button--text" style="cursor: pointer"
@@ -72,9 +64,7 @@
                         <template slot="addressDetail" slot-scope="{ row,index}">
                             <el-tooltip class="item" effect="dark" placement="top">
                                 <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
-                                <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
-                                    {{ row.addressDetail }}
-                                </div>
+                                <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.addressDetail }}</div>
                             </el-tooltip>
                         </template>
                         <template slot="status" slot-scope="{row}">
@@ -104,16 +94,17 @@
 
 <script>
 import {active, frequency} from "@/api/wel";
-import {location} from "@/api/gaude";
+import {gaude, location} from "@/api/gaude";
+import data from "@/views/util/data";
 
 export default {
     name: "basicContainer",
     props: {
         sysType: Number
     },
-    watch: {
-        mold: {
-            handler(newValue, oldValue) {
+    watch:{
+        mold:{
+            handler(newValue, oldValue){
                 this.reset()
             }
         }
@@ -240,13 +231,13 @@ export default {
                     index: 1,
                     width: 150,
                     overHidden: true,
-                }, {
+                },{
                     label: '客户名称',
                     prop: 'corpShortName',
                     index: 2,
                     width: 100,
                     overHidden: true,
-                }, {
+                },{
                     label: '业务员',
                     prop: 'salesmanName',
                     index: 2,
@@ -347,7 +338,7 @@ export default {
                     index: 1,
                     width: 150,
                     overHidden: true,
-                }, {
+                },{
                     label: '客户名称',
                     prop: 'corpShortName',
                     index: 2,
@@ -359,7 +350,7 @@ export default {
                     index: 3,
                     width: 70,
                     overHidden: true,
-                }, {
+                },{
                     label: '运输调度',
                     prop: 'dispatcherName',
                     overHidden: true,
@@ -435,7 +426,7 @@ export default {
                     index: 15,
                     width: 100,
                     overHidden: true,
-                }, {
+                },{
                     label: '应付杂费',
                     prop: 'extraAmountC',
                     index: 16,
@@ -472,7 +463,7 @@ export default {
                     overHidden: true,
                     index: 2,
                     width: 80
-                }, {
+                },{
                     label: '运输调度',
                     prop: 'dispatcherName',
                     overHidden: true,
@@ -536,7 +527,7 @@ export default {
                     index: 12,
                     width: 100,
                     overHidden: true,
-                }, {
+                },{
                     label: '应付杂费',
                     prop: 'extraAmountC',
                     index: 13,
@@ -556,7 +547,7 @@ export default {
         this.option = await this.getColumnData(this.getColumnName(140), this.optionList);
         if (this.roleName.indexOf('客户') !== -1) {
             this.bulkCargoList = this.bulkCargoListOne
-        } else if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('admin') !== -1) {
+        } else if (this.roleName.indexOf('平台') !== -1||this.roleName.indexOf('admin') !== -1) {
             this.bulkCargoList = this.bulkCargoListTwo
         } else if (this.roleName.indexOf('车队') !== -1) {
             this.bulkCargoList = this.bulkCargoListThree
@@ -567,14 +558,14 @@ export default {
         this.key++
 
 
-        let menuobj = {status: 0, mold: 1,}
+        let menuobj = {status:0, mold:1,}
         //从缓存中获取所有路由信息 判断菜单权限
         let menu = JSON.parse(localStorage.getItem("saber-menuAll")).content
-        for (let item of menu) {
+        for (let item of menu){
             if (item.id == '1499196328461225986') {
                 menuobj.mold = 1
                 break;
-            } else {
+            }else {
                 if (item.id == '1673857442015977474') {
                     menuobj.mold = 3
                     break;
@@ -596,7 +587,7 @@ export default {
                     index: 2,
                     width: 100,
                     overHidden: true,
-                }, {
+                },{
                     label: '业务员',
                     prop: 'salesmanName',
                     index: 2,
@@ -681,7 +672,7 @@ export default {
                     index: 2,
                     width: 100,
                     overHidden: true,
-                }, {
+                },{
                     label: '业务员',
                     prop: 'salesmanName',
                     index: 2,
@@ -716,21 +707,21 @@ export default {
         clearInterval(this.entrustTimer); //关闭
     },
     methods: {
-        reset() {
-            if (this.roleName.indexOf('调度中心业务员') !== -1 || this.roleName.indexOf('调度中心经理') !== -1) {
-                if (this.findObject(this.option.column, "landAmountD")) {
+        reset(){
+            if (this.roleName.indexOf('调度中心业务员') !== -1 || this.roleName.indexOf('调度中心经理') !== -1){
+                if (this.findObject(this.option.column, "landAmountD")){
                     this.findObject(this.option.column, "landAmountD").hide = true
                     this.findObject(this.option.column, "landAmountD").showColumn = false
                 }
-                if (this.findObject(this.option.column, "extraAmountD")) {
+                if (this.findObject(this.option.column, "extraAmountD")){
                     this.findObject(this.option.column, "extraAmountD").hide = true
                     this.findObject(this.option.column, "extraAmountD").showColumn = false
                 }
-                if (this.findObject(this.optionTwo.column, "freightCollect")) {
+                if(this.findObject(this.optionTwo.column, "freightCollect")) {
                     this.findObject(this.optionTwo.column, "freightCollect").hide = true
                     this.findObject(this.optionTwo.column, "freightCollect").showColumn = false
                 }
-                if (this.findObject(this.optionTwo.column, "extraAmountD")) {
+                if (this.findObject(this.optionTwo.column, "extraAmountD")){
                     this.findObject(this.optionTwo.column, "extraAmountD").hide = true
                     this.findObject(this.optionTwo.column, "extraAmountD").showColumn = false
                 }
@@ -771,7 +762,7 @@ export default {
                             index: 2,
                             width: 100,
                             overHidden: true,
-                        }, {
+                        },{
                             label: '业务员',
                             prop: 'salesmanName',
                             index: 2,
@@ -851,7 +842,7 @@ export default {
                             index: 2,
                             width: 100,
                             overHidden: true,
-                        }, {
+                        },{
                             label: '业务员',
                             prop: 'salesmanName',
                             index: 2,
@@ -912,8 +903,8 @@ export default {
                 this.reset()
             }
         },
-        openTrackTwo(row, index) {
-            if (index == 0) {
+        openTrackTwo(row, index){
+            if (index == 0){
                 this.$router.push({
                     path: '/landTransportation/bulkCargo/index',
                     query: {id: row.orderId},
@@ -921,7 +912,6 @@ export default {
             }
         },
         openTrack(row, index) {
-            console.log(index, "915")
             if (index == 0) {
                 this.$router.push({
                     path: '/landTransportation/placeAnOrder/index',
@@ -949,12 +939,6 @@ export default {
             this.infoWindow.setContent(e.target.content);
             this.infoWindow.open(this.map, e.target.getPosition());
         },
-        closeInfoWindow() {
-            this.infoWindow.close();
-        },
-        openInfoWindow() {
-            this.infoWindow.open();
-        },
         initMap(data, plateNo) {
             this.map = new AMap.Map("container", {resizeEnable: true});
             this.infoWindow = new AMap.InfoWindow({
@@ -991,148 +975,6 @@ export default {
             this.marker.on('click', this.markerClick);
             this.marker.emit('click', {target: this.marker});
             this.map.setFitView();
-            /*var center = new TMap.LatLng(39.984104, 116.307503);//设置中心点坐标
-            //初始化地图
-            var map = new TMap.Map("container", {
-                center: center
-            });
-            //初始marker
-            var marker = new TMap.MultiMarker({
-                id: 'marker-layer',
-                map: map,
-                styles: {
-                    "marker": new TMap.MarkerStyle({
-                        "width": 24,
-                        "height": 35,
-                        "anchor": { x: 12, y: 35 },
-                        "src": 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/markerDefault.png'
-                    })
-                },
-                geometries: [{
-                    "id": 'demo1',
-                    "styleId": 'marker',
-                    "position": new TMap.LatLng(39.984104, 116.307503),
-                    "properties": {
-                        "title": "marker"
-                    }
-                }, {
-                    "id": 'demo2',
-                    "styleId": 'marker',
-                    "position": new TMap.LatLng(39.974104, 116.347503),
-                    "properties": {
-                        "title": "marker"
-                    },
-
-                }]
-            });
-            //初始化infoWindow
-            var infoWindow = new TMap.InfoWindow({
-                map: map,
-                position: new TMap.LatLng(39.984104, 116.307503),
-                offset: { x: 0, y: -32 } //设置信息窗相对position偏移像素
-            });
-            infoWindow.close();//初始关闭信息窗关闭
-            //监听标注点击事件
-            marker.on("click", function (evt) {
-                //设置infoWindow
-                infoWindow.open(); //打开信息窗
-                infoWindow.setPosition(evt.geometry.position);//设置信息窗位置
-                infoWindow.setContent(evt.geometry.position.toString());//设置信息窗内容
-            })*/
-           /* var rightClicked = false;
-            if (data.location == null) {
-                data.location = [40.040422,116.273521]
-            }
-            var lon = data.location[0]
-            var lat = data.location[1]
-            console.log(lon,"1048")
-            console.log(lat,"1049")
-            this.map = new TMap.Map('container', {
-                zoom: 16,
-                pitch: 30,
-                rotation: 10,
-                center: new TMap.LatLng(lon, lat),
-            });
-
-            this.marker = new TMap.MultiMarker({
-                id: 'marker-layer', // 图层id
-                map: this.map,
-                styles: {
-                    // 点标注的相关样式
-                    marker: new TMap.MarkerStyle({
-                        width: 25,
-                        height: 35,
-                        anchor: {x: 16, y: 32},
-                        src:
-                            'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/markerDefault.png',
-                    }),
-                },
-                geometries: [
-                    {
-                        // 点标注数据数组
-                        id: 'demo',
-                        styleId: 'marker',
-                        position: new TMap.LatLng(lon, lat),
-                    },
-                ],
-            });
-            this.marker.on('click', this.openInfoWindow);
-            this.infoWindow = new TMap.InfoWindow({
-                map: this.map,
-                enableCustom: true,
-                position: new TMap.LatLng(lon, lat),
-                offset: {y: -70, x: -5},
-                content:
-                    '<div style="width: 300px;background-color: #fff">'
-                    + '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #000000;">' + plateNo + '</p>'
-                    + '<p style="padding: 5px 0"><span style="color: #a0a0a0">最后上报时间:</span>' + new Date(Number(data.time) + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19) + '</p>'
-                    + '<div style="width: 150px;float: left;">'
-                    + '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span>' + (data.speed > 0 ? '行驶中' : '停车') + '</p>'
-                    + '</div>'
-                    + '<div style="width: 150px;float: right;">'
-                    + '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' + data.speed + 'km/h</p>'
-                    + '</div>'
-                    + '<p><span style="color: #a0a0a0">当前位置:</span>' + data.address + '</p>'
-                    + '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' + data.location.join(',') + '</p>'
-                    + '</div>'
-            });
-            this.map.on('rightclick', function () {
-                // infoWindow的内容可以动态更新
-                rightClicked = !rightClicked;
-                if (rightClicked) {
-                    this.infoWindow.setContent(
-                        '<div style="width: 300px;background-color: #fff">'
-                        + '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #000000;">' + plateNo + '</p>'
-                        + '<p style="padding: 5px 0"><span style="color: #a0a0a0">最后上报时间:</span>' + new Date(Number(data.time) + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19) + '</p>'
-                        + '<div style="width: 150px;float: left;">'
-                        + '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span>' + (data.speed > 0 ? '行驶中' : '停车') + '</p>'
-                        + '</div>'
-                        + '<div style="width: 150px;float: right;">'
-                        + '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' + data.speed + 'km/h</p>'
-                        + '</div>'
-                        + '<p><span style="color: #a0a0a0">当前位置:</span>' + data.address + '</p>'
-                        + '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' + data.location.join(',') + '</p>'
-                        + '</div>');
-                } else {
-                    this.infoWindow.setContent(
-                        '<div style="width: 300px;background-color: #fff">'
-                        + '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #000000;">' + plateNo + '</p>'
-                        + '<p style="padding: 5px 0"><span style="color: #a0a0a0">最后上报时间:</span>' + new Date(Number(data.time) + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19) + '</p>'
-                        + '<div style="width: 150px;float: left;">'
-                        + '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span>' + (data.speed > 0 ? '行驶中' : '停车') + '</p>'
-                        + '</div>'
-                        + '<div style="width: 150px;float: right;">'
-                        + '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' + data.speed + 'km/h</p>'
-                        + '</div>'
-                        + '<p><span style="color: #a0a0a0">当前位置:</span>' + data.address + '</p>'
-                        + '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' + data.location.join(',') + '</p>'
-                        + '</div>');
-                }
-            });*/
-            /*var map = new TMap.Map(document.getElementById("container"), {
-                center: new TMap.LatLng(39.916527, 116.397128), // 设定地图中心点
-                zoom: 13 // 设定地图缩放级别
-            });*/
         },
         init() {
             frequency().then(res => {
@@ -1140,8 +982,8 @@ export default {
                 this_.entrustTimer = setInterval(function () {
                     if (JSON.parse(localStorage.getItem("saber-token")).content) {
                         this_.getsalesTrend({
-                            status: this_.status,
-                            mold: this_.mold
+                            status:this_.status,
+                            mold:this_.mold
                         });
                     }
                 }, Number(res.data.data[0].dictKey) * 1000)
@@ -1169,8 +1011,8 @@ export default {
         },
         refresh() {
             this.getsalesTrend({
-                status: this.status,
-                mold: this.mold
+                status:this.status,
+                mold:this.mold
             })
         }
     }
@@ -1237,4 +1079,3 @@ export default {
     padding: 5px 5px 5px 5px !important;
 }
 </style>
-