|
@@ -1,283 +0,0 @@
|
|
-<template>
|
|
|
|
- <el-dialog
|
|
|
|
- :visible.sync="showDialog"
|
|
|
|
- :title="title"
|
|
|
|
- :modal-append-to-body="false"
|
|
|
|
- style="text-align: left"
|
|
|
|
- @close="closeDialog"
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- append-to-body
|
|
|
|
- :modal="true"
|
|
|
|
- width="90%"
|
|
|
|
- >
|
|
|
|
- <div class="user-panel" v-loading="loading">
|
|
|
|
- <el-divider></el-divider>
|
|
|
|
- <el-row class="button-group">
|
|
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- size="small"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-upload2"
|
|
|
|
- @click="batchImportVisible = true"
|
|
|
|
- >导入</el-button
|
|
|
|
- >
|
|
|
|
- </el-row>
|
|
|
|
- <el-table
|
|
|
|
- :data="tableData"
|
|
|
|
- style="min-height: 400px"
|
|
|
|
- v-loading="loading"
|
|
|
|
- stripe
|
|
|
|
- @sort-change="sortChange"
|
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
|
- >
|
|
|
|
- <el-table-column
|
|
|
|
- type="index"
|
|
|
|
- label="序号"
|
|
|
|
- :index="indexMethod"
|
|
|
|
- width="50"
|
|
|
|
- ></el-table-column>
|
|
|
|
- <el-table-column
|
|
|
|
- prop="name"
|
|
|
|
- label="站名"
|
|
|
|
- width="200px"
|
|
|
|
- ></el-table-column>
|
|
|
|
- <template v-for="col in stationPriceColumns">
|
|
|
|
- <el-table-column
|
|
|
|
- :label="col.name"
|
|
|
|
- :prop="col.id"
|
|
|
|
- :key="col.id"
|
|
|
|
- width="200px"
|
|
|
|
- >
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
- <div style="display: flex; flex-direction: column">
|
|
|
|
- <template
|
|
|
|
- v-for="(item, index) in row.stationPriceMap[col.id]"
|
|
|
|
- >
|
|
|
|
- <div v-html="showItem(item,col.id)" :key="index"></div>
|
|
|
|
- </template>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </template>
|
|
|
|
- </el-table>
|
|
|
|
- <el-dialog
|
|
|
|
- title="导入"
|
|
|
|
- :visible.sync="batchImportVisible"
|
|
|
|
- :modal-append-to-body="false"
|
|
|
|
- style="text-align: left"
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- >
|
|
|
|
- <el-form label-width="150px">
|
|
|
|
- <el-form-item label="模板下载">
|
|
|
|
- <el-link
|
|
|
|
- href="http://rccs.oss-cn-hangzhou.aliyuncs.com/smart-bus/excel/routeInfo.xls"
|
|
|
|
- type="primary"
|
|
|
|
- target="_blank"
|
|
|
|
- >点击下载模板</el-link
|
|
|
|
- >
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="上传文件">
|
|
|
|
- <el-upload
|
|
|
|
- class="upload-demo"
|
|
|
|
- accept=".xls"
|
|
|
|
- :action="uploadUrlXls"
|
|
|
|
- :data="uploadXlsData"
|
|
|
|
- :headers="headers"
|
|
|
|
- :on-preview="handleBatchImportPreview"
|
|
|
|
- name="uploadFile"
|
|
|
|
- :multiple="true"
|
|
|
|
- :limit="1"
|
|
|
|
- :on-remove="handleBatchImportRemove"
|
|
|
|
- :before-remove="beforeBatchImportRemove"
|
|
|
|
- :before-upload="beforeUpload"
|
|
|
|
- :on-exceed="handleBatchImportExceed"
|
|
|
|
- :on-success="handleBatchImportSuccess"
|
|
|
|
- :file-list="batchImportFileList"
|
|
|
|
- >
|
|
|
|
- <el-button size="small" type="primary" :loading="xlsLoading"
|
|
|
|
- >点击上传</el-button
|
|
|
|
- >
|
|
|
|
- <div slot="tip" class="el-upload__tip">
|
|
|
|
- 只能上传xls文件,且不超过500kb
|
|
|
|
- </div>
|
|
|
|
- </el-upload>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button type="primary" @click="batchImportVisible = false"
|
|
|
|
- >关 闭</el-button
|
|
|
|
- >
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
- <!--批量导入E-->
|
|
|
|
- </div>
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
- <el-button @click="closeDialog">取 消</el-button>
|
|
|
|
- </span>
|
|
|
|
- </el-dialog>
|
|
|
|
-</template>
|
|
|
|
-<script>
|
|
|
|
-import Constant from "@/constant";
|
|
|
|
-import shiftInfoApi from "@/api/bus/shiftInfo";
|
|
|
|
-
|
|
|
|
-import passengerInfoApi from "@/api/bus/passengerInfo";
|
|
|
|
-import priceInfoApi from "@/api/bus/priceInfo";
|
|
|
|
-
|
|
|
|
-export default {
|
|
|
|
- props: ["businessKey", "title"],
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- queryModel: {
|
|
|
|
- vehicleShiftId: "",
|
|
|
|
- vehiclePersonId: "",
|
|
|
|
- userId: "",
|
|
|
|
- userName: "",
|
|
|
|
- status: "",
|
|
|
|
- payStatus: "",
|
|
|
|
- },
|
|
|
|
- loading: false,
|
|
|
|
- tableData: [],
|
|
|
|
- pageIndex: 1,
|
|
|
|
- pageSize: 5,
|
|
|
|
- totalPages: 0,
|
|
|
|
- totalElements: 0,
|
|
|
|
- field: "",
|
|
|
|
- direction: "",
|
|
|
|
- pageSizeList: [5, 15, 30],
|
|
|
|
- multipleSelection: [],
|
|
|
|
- showModal: false,
|
|
|
|
- modalTitle: "",
|
|
|
|
- showDialog: true,
|
|
|
|
- stationPriceColumns: [],
|
|
|
|
- batchImportVisible:false,
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- indexMethod(index) {
|
|
|
|
- return (this.pageIndex - 1) * this.pageSize + (index + 1);
|
|
|
|
- },
|
|
|
|
- changePage(pageIndex) {
|
|
|
|
- var self = this;
|
|
|
|
- self.loading = true;
|
|
|
|
-
|
|
|
|
- self.pageIndex = pageIndex;
|
|
|
|
- var formData = new FormData();
|
|
|
|
-
|
|
|
|
- formData.append("routeId", self.businessKey);
|
|
|
|
-
|
|
|
|
- priceInfoApi
|
|
|
|
- .searchRoutePrice(formData)
|
|
|
|
- .then(function (response) {
|
|
|
|
- self.loading = false;
|
|
|
|
-
|
|
|
|
- var jsonData = response.data;
|
|
|
|
- self.tableData = jsonData.stationInfoList;
|
|
|
|
- self.stationPriceColumns = jsonData.stationPriceColumns;
|
|
|
|
- })
|
|
|
|
- .catch((error) => {
|
|
|
|
- self.loading = false;
|
|
|
|
- // self.$message.error(error + "");
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- pageSizeChange(pageSize) {
|
|
|
|
- this.pageSize = pageSize;
|
|
|
|
-
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.changePage(this.pageIndex);
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- sortChange(data) {
|
|
|
|
- this.field = data.column.field;
|
|
|
|
- this.direction = data.order;
|
|
|
|
-
|
|
|
|
- this.changePage(this.pageIndex);
|
|
|
|
- },
|
|
|
|
- handleSelectionChange(val) {
|
|
|
|
- this.multipleSelection = val;
|
|
|
|
- },
|
|
|
|
- handleReset(name) {
|
|
|
|
- this.$refs[name].resetFields();
|
|
|
|
- },
|
|
|
|
- handleAdd() {
|
|
|
|
- this.modalTitle = "新增";
|
|
|
|
- this.businessKey = "";
|
|
|
|
- this.showModal = true;
|
|
|
|
- },
|
|
|
|
- handleEdit(record) {
|
|
|
|
- this.modalTitle = "编辑";
|
|
|
|
- this.businessKey = record.id;
|
|
|
|
- this.showModal = true;
|
|
|
|
- },
|
|
|
|
- handleDelete(record) {
|
|
|
|
- var self = this;
|
|
|
|
-
|
|
|
|
- self
|
|
|
|
- .$confirm("是否确认删除?", "提示", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "warning",
|
|
|
|
- })
|
|
|
|
- .then(() => {
|
|
|
|
- passengerInfoApi.remove(record.id).then(function (response) {
|
|
|
|
- var jsonData = response.data;
|
|
|
|
-
|
|
|
|
- if (jsonData.result) {
|
|
|
|
- // var index = self.tableData.indexOf(record);
|
|
|
|
- // self.tableData.splice(index, 1);
|
|
|
|
- self.changePage(self.pageIndex);
|
|
|
|
-
|
|
|
|
- self.$message({
|
|
|
|
- type: "success",
|
|
|
|
- message: "删除成功!",
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- handleBatchDelete() {
|
|
|
|
- var self = this;
|
|
|
|
-
|
|
|
|
- var idList = this.multipleSelection.map((record) => {
|
|
|
|
- return record.id;
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- this.$confirm("是否确认删除选中项?", "提示", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "warning",
|
|
|
|
- }).then(() => {
|
|
|
|
- passengerInfoApi.batchRemove(idList).then(function (response) {
|
|
|
|
- var jsonData = response.data;
|
|
|
|
-
|
|
|
|
- if (jsonData.result) {
|
|
|
|
- self.changePage(self.pageIndex);
|
|
|
|
-
|
|
|
|
- self.$message({
|
|
|
|
- type: "success",
|
|
|
|
- message: "删除成功!",
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- closeDialog() {
|
|
|
|
- this.$emit("close", false);
|
|
|
|
- },
|
|
|
|
- onDetailModalClose(refreshed) {
|
|
|
|
- //保存成功后回调
|
|
|
|
- this.showModal = false;
|
|
|
|
-
|
|
|
|
- if (refreshed) {
|
|
|
|
- this.changePage(this.pageIndex);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- showItem(item,id) {
|
|
|
|
- return item;
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- mounted: function () {
|
|
|
|
- this.changePage(1);
|
|
|
|
- },
|
|
|
|
-};
|
|
|
|
-</script>
|
|
|