作者 xudada

运输工具通用查询

... ... @@ -7,20 +7,19 @@
</el-col>
</el-row>
<el-row>
<el-form :label-position="labelPosition" :model="queryRoute" :rules="rules" ref="queryRoute" label-width="130px" class="demo-ruleForm">
<el-col :span="6">
<el-form-item label="航线序号" prop="seqNo" label-width="70px">
<el-input v-model="queryRoute.seqNo"></el-input>
</el-form-item>
<el-input v-model="serialNo" placeholder="请输入航线序号"></el-input>
</el-col>
<el-col :span="3"> <el-button type="primary" @click="submitForm('queryRoute')">保 存</el-button></el-col>
</el-form>
<el-col :span="3"> <el-button type="primary" @click="submitForm()">查 询</el-button></el-col>
</el-row>
<el-row>
<el-col :span="24">
<template>
<el-table
:data="tableData"
border
style="width: 100%;margin-bottom: 10px">
v-loading="tableloading"
style="width:100%;margin-bottom: 10px">
<el-table-column
fixed="left"
label="操作"
... ... @@ -29,7 +28,7 @@
<el-button
size="mini"
type="primary"
@click="handleEdit(scope.$index, scope.row)">选择</el-button>
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
</template>
</el-table-column>
<el-table-column
... ... @@ -93,18 +92,23 @@
width="150">
</el-table-column>
<el-table-column
fixed
prop="remark"
label="报文操作"
width="150">
width="250">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
@click="handleEdit(scope.$index, scope.row)">选择</el-button>
@click="handleDetail(scope.$index, scope.row)">查看明细</el-button>
<el-button
size="mini"
type="primary"
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-col>
</el-row>
<el-row>
<div class="block">
... ... @@ -112,10 +116,10 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[100, 200, 300, 400]"
:page-size="100"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="400">
:total="total">
</el-pagination>
</div>
</el-row>
... ... @@ -140,27 +144,86 @@
}
</style>
<script>
import {editRoute, selectRoute} from "../../api/transport";
export default {
data(){
return{
queryRoute:{
seqNo:undefined
},
rules:{},
serialNo:undefined,
labelPosition:'left',
currentPage: 4,
tableData:[]
currentPage: 1,
pageSize:10,
total:0,
tableData:[],
tableloading:false
}
},
methods: {
//分页方法
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.pageSize=val;
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.currentPage=val;
},
//获取航线列表
submitForm(){
let params={currentPage:this.currentPage,pageSize:this.pageSize,serialNo:this.serialNo};
this.tableloading=true;
selectRoute(params).then(res=>{
let response=res.data.data;
this.tableData=response.list;
this.tableloading=false;
this.total=response.total;
});
},
//编辑航线功能
handleEdit(index,row){
this.$router.push({path:'/route',query:{uuid:JSON.stringify(row.uuid),serialNo:JSON.stringify(row.serialNo),departurePort:JSON.stringify(row.departurePort),
arrivalPort:JSON.stringify(row.arrivalPort),departureCustomNo:JSON.stringify(row.departureCustomNo),arrivalCustomNo:JSON.stringify(row.arrivalCustomNo),
cancelFlag:JSON.stringify(row.cancelFlag),meno:JSON.stringify(row.meno),planno:JSON.stringify(row.planno),std:JSON.stringify(row.std),
sta:JSON.stringify(row.sta),effStartdate:JSON.stringify(row.effStartdate),effEnddate:JSON.stringify(row.effEnddate),plan:JSON.stringify(row.plan),
remark:JSON.stringify(row.remark),createTime:JSON.stringify(row.createTime),createBy:JSON.stringify(row.createBy),updateTime:JSON.stringify(row.updateTime),
updateBy:JSON.stringify(row.updateBy),isDelete:JSON.stringify(row.isDelete)}})
},
//获取默认值
defaultData(){
this.serialNo=JSON.parse(this.$route.query.serialNo);
},
//列表删除功能
handleDelete(index,row){
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
editRoute(row).then(res=>{
let response=res.data;
if(response.code=='200'){
this.$message({
type: 'info',
message: '删除成功'
});
this.submitForm();
}else{
this.$message({
type: 'info',
message: '删除失败'
}); }
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
},
//渲染方法
mounted(){
this.defaultData();
this.submitForm();
}
}
</script>
... ...
... ... @@ -200,7 +200,7 @@
<script>
const fecha = require('fecha');
import {addRoute,selectRoute} from '../../api/transport'
import {addRoute} from '../../api/transport'
export default {
data(){
return{
... ... @@ -258,7 +258,7 @@
}
},
methods:{
//保存航线方法
//新增航线方法
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
... ... @@ -267,6 +267,8 @@
if(response.code=='200'){
this.centerDialogVisible=true;
this.msg=response.msg;
this.$router.push({path:'/queryRoute',query:{serialNo:JSON.stringify(this.airline.serialNo)}});
this.centerDialogVisible=false;
}else{
this.centerDialogVisible=true;
this.msg=response.msg;
... ... @@ -278,6 +280,7 @@
}
});
},
//分页方法
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
... ... @@ -291,7 +294,36 @@
this.airline.effStartdate=row.effStartdate;
this.airline.effEnddate=row.effEnddate;
this.dialogTableVisible=false;
},
//加载默认值
defaultData(){
if(this.$route.query!=null){
this.airline.uuid=JSON.parse(this.$route.query.uuid);
this.airline.serialNo=JSON.parse(this.$route.query.serialNo);
this.airline.departurePort=JSON.parse(this.$route.query.departurePort);
this.airline.arrivalPort=JSON.parse(this.$route.query.arrivalPort);
this.airline.departureCustomNo=JSON.parse(this.$route.query.departureCustomNo);
this.airline.arrivalCustomNo=JSON.parse(this.$route.query.arrivalCustomNo);
this.airline.cancelFlag=JSON.parse(this.$route.query.cancelFlag);
this.airline.meno=JSON.parse(this.$route.query.meno);
this.airline.planno=JSON.parse(this.$route.query.planno);
this.airline.std=fecha.parse(JSON.parse(this.$route.query.std),'HHmmss');
this.airline.sta=fecha.parse(JSON.parse(this.$route.query.sta),'HHmmss');
this.airline.effStartdate=JSON.parse(this.$route.query.effStartdate);
this.airline.effEnddate=JSON.parse(this.$route.query.effEnddate);
this.airline.plan=JSON.parse(this.$route.query.plan);
this.airline.remark=JSON.parse(this.$route.query.remark);
this.airline.createTime=JSON.parse(this.$route.query.createTime);
this.airline.createBy=JSON.parse(this.$route.query.createBy);
this.airline.updateTime=JSON.parse(this.$route.query.updateTime);
this.airline.updateBy=JSON.parse(this.$route.query.updateBy);
this.airline.isDelete=JSON.parse(this.$route.query.isDelete);
}
}
},
//渲染方法
mounted(){
this.defaultData();
}
}
</script>
\ No newline at end of file
... ...