|
@@ -23,8 +23,7 @@
|
|
|
:options="companyResult"
|
|
|
v-model="queryModel.companyId"
|
|
|
height="200"
|
|
|
- ></el-select-tree
|
|
|
- >
|
|
|
+ ></el-select-tree>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="路线名称" prop="name">
|
|
|
<el-input type="text" size="mini" v-model="queryModel.name"></el-input>
|
|
@@ -85,7 +84,7 @@
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <el-table-column
|
|
|
prop="companyName"
|
|
|
label="所属单位"
|
|
|
width="130"
|
|
@@ -105,11 +104,20 @@
|
|
|
label="结束时间"
|
|
|
width="200"
|
|
|
></el-table-column>
|
|
|
- <el-table-column label="操作" >
|
|
|
+ <el-table-column label="操作">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-button size="mini" type="warning" @click="handleEdit(row)">编辑</el-button>
|
|
|
- <el-button size="mini" type="success" @click="handleEditPath(row)">路线绘制</el-button>
|
|
|
- <el-button size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
|
|
|
+ <el-button size="mini" type="warning" @click="handleEdit(row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button size="mini" type="success" @click="handleEditPath(row)"
|
|
|
+ >路线绘制</el-button
|
|
|
+ >
|
|
|
+ <el-button size="mini" type="success" @click="handleEditPrice(row)"
|
|
|
+ >费用查看</el-button
|
|
|
+ >
|
|
|
+ <el-button size="mini" type="danger" @click="handleDelete(row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -127,51 +135,54 @@
|
|
|
:title="modalTitle"
|
|
|
@close="onDetailModalClose"
|
|
|
></routeInfo-detail>
|
|
|
- <el-dialog
|
|
|
- width="80%"
|
|
|
- :visible.sync="showMapDialog"
|
|
|
- title="路线绘制"
|
|
|
- :modal-append-to-body="true"
|
|
|
- :append-to-body="true"
|
|
|
- style="text-align:left;"
|
|
|
- :close-on-click-modal="false"
|
|
|
- v-loading="mapLoading"
|
|
|
+ <el-dialog
|
|
|
+ width="80%"
|
|
|
+ :visible.sync="showMapDialog"
|
|
|
+ title="路线绘制"
|
|
|
+ :modal-append-to-body="true"
|
|
|
+ :append-to-body="true"
|
|
|
+ style="text-align: left"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ v-loading="mapLoading"
|
|
|
>
|
|
|
- <el-amap
|
|
|
- ref="roadlineMap"
|
|
|
- vid="roadlineMap"
|
|
|
- :plugin="plugin"
|
|
|
- :center="centerPoint"
|
|
|
- :zoom="15"
|
|
|
- style="width:100%;height:400px;"
|
|
|
- >
|
|
|
- <!--站点-->
|
|
|
- <el-amap-marker :zIndex="1"
|
|
|
- v-for="station in stationList"
|
|
|
- :key="station.id"
|
|
|
- :position="station.position"
|
|
|
- :title="station.title"></el-amap-marker>
|
|
|
- <!--路线-->
|
|
|
- <el-amap-polyline :path="mapPath"
|
|
|
- :zIndex="2"
|
|
|
- :isOutline="true"
|
|
|
- :outlineColor="'#ffeeff'"
|
|
|
- :borderWeight="3"
|
|
|
- :strokeColor="'#3366FF'"
|
|
|
- :strokeOpacity="1"
|
|
|
- :strokeWeight="6"
|
|
|
- :strokeStyle="'solid'"
|
|
|
- :strokeDasharray="[10, 5]"
|
|
|
- :lineJoin="'round'"
|
|
|
- :lineCap="'round'"
|
|
|
- :editable="true"
|
|
|
- ></el-amap-polyline>
|
|
|
- </el-amap>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
+ <el-amap
|
|
|
+ ref="roadlineMap"
|
|
|
+ vid="roadlineMap"
|
|
|
+ :plugin="plugin"
|
|
|
+ :center="centerPoint"
|
|
|
+ :zoom="15"
|
|
|
+ style="width: 100%; height: 400px"
|
|
|
+ >
|
|
|
+ <!--站点-->
|
|
|
+ <el-amap-marker
|
|
|
+ :zIndex="1"
|
|
|
+ v-for="station in stationList"
|
|
|
+ :key="station.id"
|
|
|
+ :position="station.position"
|
|
|
+ :title="station.title"
|
|
|
+ ></el-amap-marker>
|
|
|
+ <!--路线-->
|
|
|
+ <el-amap-polyline
|
|
|
+ :path="mapPath"
|
|
|
+ :zIndex="2"
|
|
|
+ :isOutline="true"
|
|
|
+ :outlineColor="'#ffeeff'"
|
|
|
+ :borderWeight="3"
|
|
|
+ :strokeColor="'#3366FF'"
|
|
|
+ :strokeOpacity="1"
|
|
|
+ :strokeWeight="6"
|
|
|
+ :strokeStyle="'solid'"
|
|
|
+ :strokeDasharray="[10, 5]"
|
|
|
+ :lineJoin="'round'"
|
|
|
+ :lineCap="'round'"
|
|
|
+ :editable="true"
|
|
|
+ ></el-amap-polyline>
|
|
|
+ </el-amap>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="handleConnectStation()">站点连线</el-button>
|
|
|
<el-button @click="handleMapPathConfirm()">确定</el-button>
|
|
|
- <el-button @click="showMapDialog=false;">关闭</el-button>
|
|
|
- </span>
|
|
|
+ <el-button @click="showMapDialog = false">关闭</el-button>
|
|
|
+ </span>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
|
title="导入"
|
|
@@ -273,6 +284,7 @@ export default {
|
|
|
batchImportVisible: false,
|
|
|
batchImportFileList: [],
|
|
|
showMapDialog: false,
|
|
|
+ showPriceModal: false,
|
|
|
uploadUrlXls: Constant.serverUrl + "/bus/routeInfo/importXls",
|
|
|
uploadXlsData: {
|
|
|
subFolder: "driver",
|
|
@@ -282,23 +294,28 @@ export default {
|
|
|
},
|
|
|
xlsLoading: false,
|
|
|
sceneData: [],
|
|
|
- typeData:[],
|
|
|
+ typeData: [],
|
|
|
selectRoute: null,
|
|
|
centerPoint: [112.276585, 30.306401],
|
|
|
stationList: [
|
|
|
- {id: 1, position: [112.276585, 30.306401], content: ''},
|
|
|
- {id: 2, position: [112.275276, 30.306827], content: ''}
|
|
|
+ { id: 1, position: [112.276585, 30.306401], content: "" },
|
|
|
+ { id: 2, position: [112.275276, 30.306827], content: "" },
|
|
|
+ ],
|
|
|
+ mapPath: [
|
|
|
+ [112.276585, 30.306401],
|
|
|
+ [112.275276, 30.306827],
|
|
|
],
|
|
|
- mapPath: [[112.276585, 30.306401], [112.275276, 30.306827]],
|
|
|
mapLoading: false,
|
|
|
- plugin: [{
|
|
|
- pName: 'ToolBar',
|
|
|
+ plugin: [
|
|
|
+ {
|
|
|
+ pName: "ToolBar",
|
|
|
events: {
|
|
|
- init(instance) {
|
|
|
- console.log(instance);
|
|
|
- }
|
|
|
- }
|
|
|
- }],
|
|
|
+ init(instance) {
|
|
|
+ console.log(instance);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -315,23 +332,21 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
changePage(pageIndex) {
|
|
|
- var self = this;
|
|
|
-
|
|
|
- self.loading = true;
|
|
|
+ var self = this;
|
|
|
|
|
|
- self.pageIndex = pageIndex;
|
|
|
- var formData = new FormData();
|
|
|
+ self.loading = true;
|
|
|
|
|
|
- formData.append("pageIndex", self.pageIndex);
|
|
|
- formData.append("pageSize", self.pageSize);
|
|
|
+ self.pageIndex = pageIndex;
|
|
|
+ var formData = new FormData();
|
|
|
|
|
|
- if(self.queryModel.companyId!=null){
|
|
|
- formData.append("companyId", self.queryModel.companyId);
|
|
|
- }
|
|
|
-
|
|
|
- formData.append("name", self.queryModel.name);
|
|
|
+ formData.append("pageIndex", self.pageIndex);
|
|
|
+ formData.append("pageSize", self.pageSize);
|
|
|
|
|
|
+ if (self.queryModel.companyId != null) {
|
|
|
+ formData.append("companyId", self.queryModel.companyId);
|
|
|
+ }
|
|
|
|
|
|
+ formData.append("name", self.queryModel.name);
|
|
|
|
|
|
routeInfoApi
|
|
|
.pageList(formData)
|
|
@@ -435,6 +450,7 @@ export default {
|
|
|
//保存成功后回调
|
|
|
this.showModal = false;
|
|
|
this.showDeviceModal = false;
|
|
|
+ this.showPriceModal = false;
|
|
|
|
|
|
if (refreshed) {
|
|
|
this.changePage(this.pageIndex);
|
|
@@ -497,96 +513,113 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
handleMapPathConfirm() {
|
|
|
- this.mapLoading = true;
|
|
|
+ this.mapLoading = true;
|
|
|
|
|
|
- var pathList = this.mapPath.map((item) => {
|
|
|
- return item.lng + "," + item.lat;
|
|
|
- });
|
|
|
+ var pathList = this.mapPath.map((item) => {
|
|
|
+ return item.lng + "," + item.lat;
|
|
|
+ });
|
|
|
|
|
|
- routeInfoApi.updateMapPath({
|
|
|
- id: this.selectRoute.id,
|
|
|
- pathList: pathList
|
|
|
- }).then(response => {
|
|
|
- this.mapLoading = false;
|
|
|
+ routeInfoApi
|
|
|
+ .updateMapPath({
|
|
|
+ id: this.selectRoute.id,
|
|
|
+ pathList: pathList,
|
|
|
+ })
|
|
|
+ .then((response) => {
|
|
|
+ this.mapLoading = false;
|
|
|
|
|
|
- var jsonData = response.data;
|
|
|
+ var jsonData = response.data;
|
|
|
|
|
|
- if (jsonData.result) {
|
|
|
- this.showMapDialog = false;
|
|
|
- this.$message.success("保存成功!");
|
|
|
- } else {
|
|
|
- this.$message.warning("系统错误!" + jsonData.message);
|
|
|
- }
|
|
|
+ if (jsonData.result) {
|
|
|
+ this.showMapDialog = false;
|
|
|
+ this.$message.success("保存成功!");
|
|
|
+ } else {
|
|
|
+ this.$message.warning("系统错误!" + jsonData.message);
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
handleConnectStation() {
|
|
|
- this.$confirm("是否确认根据站点重新绘制路线?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.mapPath = [];
|
|
|
- this.stationList.forEach((item) => {
|
|
|
- this.mapPath.push(item.position);
|
|
|
- });
|
|
|
- });
|
|
|
+ this.$confirm("是否确认根据站点重新绘制路线?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.mapPath = [];
|
|
|
+ this.stationList.forEach((item) => {
|
|
|
+ this.mapPath.push(item.position);
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
handleEditPath(row) {
|
|
|
- //读取当前路线的站点
|
|
|
- this.loading = true;
|
|
|
+ //读取当前路线的站点
|
|
|
+ this.loading = true;
|
|
|
|
|
|
- routeInfoApi.edit(row.id).then(response => {
|
|
|
- this.loading = false;
|
|
|
+ routeInfoApi.edit(row.id).then((response) => {
|
|
|
+ this.loading = false;
|
|
|
|
|
|
- var jsonData = response.data;
|
|
|
- var model = jsonData.data;
|
|
|
+ var jsonData = response.data;
|
|
|
+ var model = jsonData.data;
|
|
|
|
|
|
- var _stationList = model.stationList;
|
|
|
+ var _stationList = model.stationList;
|
|
|
|
|
|
- if (model.pathList != null) {
|
|
|
- this.mapPath = model.pathList.map((item) => {
|
|
|
- return item.split(",");
|
|
|
- });
|
|
|
-
|
|
|
- this.centerPoint = this.mapPath[0];
|
|
|
- } else {
|
|
|
- this.mapPath = [];
|
|
|
- }
|
|
|
+ if (model.pathList != null) {
|
|
|
+ this.mapPath = model.pathList.map((item) => {
|
|
|
+ return item.split(",");
|
|
|
+ });
|
|
|
|
|
|
- if (_stationList.length <= 1) {
|
|
|
- this.$message.warning("请先至少设置2个站点!");
|
|
|
- } else {
|
|
|
- this.selectRoute = row;
|
|
|
- this.showMapDialog = true;
|
|
|
+ this.centerPoint = this.mapPath[0];
|
|
|
+ } else {
|
|
|
+ this.mapPath = [];
|
|
|
+ }
|
|
|
|
|
|
- this.stationList = [];
|
|
|
+ if (_stationList.length <= 1) {
|
|
|
+ this.$message.warning("请先至少设置2个站点!");
|
|
|
+ } else {
|
|
|
+ this.selectRoute = row;
|
|
|
+ this.showMapDialog = true;
|
|
|
|
|
|
- var initMapPath = this.mapPath.length == 0;
|
|
|
+ this.stationList = [];
|
|
|
|
|
|
- _stationList.forEach((item) => {
|
|
|
- if (item.location != null && item.location.length > 0) {
|
|
|
- var station = {
|
|
|
- id: item.id,
|
|
|
- title: item.name,
|
|
|
- position: item.location.split(",")
|
|
|
- }
|
|
|
+ var initMapPath = this.mapPath.length == 0;
|
|
|
|
|
|
- this.stationList.push(station);
|
|
|
+ _stationList.forEach((item) => {
|
|
|
+ if (item.location != null && item.location.length > 0) {
|
|
|
+ var station = {
|
|
|
+ id: item.id,
|
|
|
+ title: item.name,
|
|
|
+ position: item.location.split(","),
|
|
|
+ };
|
|
|
|
|
|
- if (initMapPath) {
|
|
|
- this.mapPath.push(station.position);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ this.stationList.push(station);
|
|
|
|
|
|
- if(this.mapPath.length>0){
|
|
|
- this.centerPoint = this.mapPath[0];
|
|
|
- }
|
|
|
+ if (initMapPath) {
|
|
|
+ this.mapPath.push(station.position);
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
+ });
|
|
|
|
|
|
+ if (this.mapPath.length > 0) {
|
|
|
+ this.centerPoint = this.mapPath[0];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleEditPrice(record) {
|
|
|
+
|
|
|
+ var path = "/bus/routeInfo/priceList";
|
|
|
+
|
|
|
+
|
|
|
+ this.$store.dispatch('tagsView/delView', {
|
|
|
+ name: "BusRouteInfoList",
|
|
|
+ path: path
|
|
|
+ }).then(({ visitedViews }) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: path,
|
|
|
+ query:{
|
|
|
+ routeId: record.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
mounted: function () {},
|
|
|
components: {
|