作者 xudada

运输工具通用查询

@@ -7,20 +7,19 @@ @@ -7,20 +7,19 @@
7 </el-col> 7 </el-col>
8 </el-row> 8 </el-row>
9 <el-row> 9 <el-row>
10 - <el-form :label-position="labelPosition" :model="queryRoute" :rules="rules" ref="queryRoute" label-width="130px" class="demo-ruleForm">  
11 <el-col :span="6"> 10 <el-col :span="6">
12 - <el-form-item label="航线序号" prop="seqNo" label-width="70px">  
13 - <el-input v-model="queryRoute.seqNo"></el-input>  
14 - </el-form-item> 11 + <el-input v-model="serialNo" placeholder="请输入航线序号"></el-input>
15 </el-col> 12 </el-col>
16 - <el-col :span="3"> <el-button type="primary" @click="submitForm('queryRoute')">保 存</el-button></el-col>  
17 - </el-form> 13 + <el-col :span="3"> <el-button type="primary" @click="submitForm()">查 询</el-button></el-col>
18 </el-row> 14 </el-row>
19 <el-row> 15 <el-row>
  16 + <el-col :span="24">
  17 + <template>
20 <el-table 18 <el-table
21 :data="tableData" 19 :data="tableData"
22 border 20 border
23 - style="width: 100%;margin-bottom: 10px"> 21 + v-loading="tableloading"
  22 + style="width:100%;margin-bottom: 10px">
24 <el-table-column 23 <el-table-column
25 fixed="left" 24 fixed="left"
26 label="操作" 25 label="操作"
@@ -29,7 +28,7 @@ @@ -29,7 +28,7 @@
29 <el-button 28 <el-button
30 size="mini" 29 size="mini"
31 type="primary" 30 type="primary"
32 - @click="handleEdit(scope.$index, scope.row)">选择</el-button> 31 + @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
33 </template> 32 </template>
34 </el-table-column> 33 </el-table-column>
35 <el-table-column 34 <el-table-column
@@ -93,18 +92,23 @@ @@ -93,18 +92,23 @@
93 width="150"> 92 width="150">
94 </el-table-column> 93 </el-table-column>
95 <el-table-column 94 <el-table-column
96 - fixed  
97 prop="remark" 95 prop="remark"
98 label="报文操作" 96 label="报文操作"
99 - width="150"> 97 + width="250">
100 <template slot-scope="scope"> 98 <template slot-scope="scope">
101 <el-button 99 <el-button
102 size="mini" 100 size="mini"
103 type="primary" 101 type="primary"
104 - @click="handleEdit(scope.$index, scope.row)">选择</el-button> 102 + @click="handleDetail(scope.$index, scope.row)">查看明细</el-button>
  103 + <el-button
  104 + size="mini"
  105 + type="primary"
  106 + @click="handleDelete(scope.$index, scope.row)">删除</el-button>
105 </template> 107 </template>
106 </el-table-column> 108 </el-table-column>
107 </el-table> 109 </el-table>
  110 + </template>
  111 + </el-col>
108 </el-row> 112 </el-row>
109 <el-row> 113 <el-row>
110 <div class="block"> 114 <div class="block">
@@ -112,10 +116,10 @@ @@ -112,10 +116,10 @@
112 @size-change="handleSizeChange" 116 @size-change="handleSizeChange"
113 @current-change="handleCurrentChange" 117 @current-change="handleCurrentChange"
114 :current-page="currentPage" 118 :current-page="currentPage"
115 - :page-sizes="[100, 200, 300, 400]"  
116 - :page-size="100" 119 + :page-sizes="[10, 20, 30, 40]"
  120 + :page-size="pageSize"
117 layout="total, sizes, prev, pager, next, jumper" 121 layout="total, sizes, prev, pager, next, jumper"
118 - :total="400"> 122 + :total="total">
119 </el-pagination> 123 </el-pagination>
120 </div> 124 </div>
121 </el-row> 125 </el-row>
@@ -140,27 +144,86 @@ @@ -140,27 +144,86 @@
140 } 144 }
141 </style> 145 </style>
142 <script> 146 <script>
  147 + import {editRoute, selectRoute} from "../../api/transport";
  148 +
143 export default { 149 export default {
144 data(){ 150 data(){
145 return{ 151 return{
146 - queryRoute:{  
147 - seqNo:undefined  
148 - },  
149 -  
150 - rules:{}, 152 + serialNo:undefined,
151 labelPosition:'left', 153 labelPosition:'left',
152 - currentPage: 4,  
153 - tableData:[]  
154 - 154 + currentPage: 1,
  155 + pageSize:10,
  156 + total:0,
  157 + tableData:[],
  158 + tableloading:false
155 } 159 }
156 }, 160 },
157 methods: { 161 methods: {
  162 + //分页方法
158 handleSizeChange(val) { 163 handleSizeChange(val) {
159 - console.log(`每页 ${val} 条`); 164 + this.pageSize=val;
160 }, 165 },
161 handleCurrentChange(val) { 166 handleCurrentChange(val) {
162 - console.log(`当前页: ${val}`); 167 + this.currentPage=val;
  168 + },
  169 + //获取航线列表
  170 + submitForm(){
  171 + let params={currentPage:this.currentPage,pageSize:this.pageSize,serialNo:this.serialNo};
  172 + this.tableloading=true;
  173 + selectRoute(params).then(res=>{
  174 + let response=res.data.data;
  175 + this.tableData=response.list;
  176 + this.tableloading=false;
  177 + this.total=response.total;
  178 + });
  179 +
  180 + },
  181 + //编辑航线功能
  182 + handleEdit(index,row){
  183 + this.$router.push({path:'/route',query:{uuid:JSON.stringify(row.uuid),serialNo:JSON.stringify(row.serialNo),departurePort:JSON.stringify(row.departurePort),
  184 + arrivalPort:JSON.stringify(row.arrivalPort),departureCustomNo:JSON.stringify(row.departureCustomNo),arrivalCustomNo:JSON.stringify(row.arrivalCustomNo),
  185 + cancelFlag:JSON.stringify(row.cancelFlag),meno:JSON.stringify(row.meno),planno:JSON.stringify(row.planno),std:JSON.stringify(row.std),
  186 + sta:JSON.stringify(row.sta),effStartdate:JSON.stringify(row.effStartdate),effEnddate:JSON.stringify(row.effEnddate),plan:JSON.stringify(row.plan),
  187 + remark:JSON.stringify(row.remark),createTime:JSON.stringify(row.createTime),createBy:JSON.stringify(row.createBy),updateTime:JSON.stringify(row.updateTime),
  188 + updateBy:JSON.stringify(row.updateBy),isDelete:JSON.stringify(row.isDelete)}})
  189 + },
  190 + //获取默认值
  191 + defaultData(){
  192 + this.serialNo=JSON.parse(this.$route.query.serialNo);
  193 + },
  194 + //列表删除功能
  195 + handleDelete(index,row){
  196 + this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  197 + confirmButtonText: '确定',
  198 + cancelButtonText: '取消',
  199 + type: 'warning'
  200 + }).then(() => {
  201 + editRoute(row).then(res=>{
  202 + let response=res.data;
  203 + if(response.code=='200'){
  204 + this.$message({
  205 + type: 'info',
  206 + message: '删除成功'
  207 + });
  208 + this.submitForm();
  209 + }else{
  210 + this.$message({
  211 + type: 'info',
  212 + message: '删除失败'
  213 + }); }
  214 + });
  215 + }).catch(() => {
  216 + this.$message({
  217 + type: 'info',
  218 + message: '已取消删除'
  219 + });
  220 + });
163 } 221 }
164 }, 222 },
  223 + //渲染方法
  224 + mounted(){
  225 + this.defaultData();
  226 + this.submitForm();
  227 + }
165 } 228 }
166 </script> 229 </script>
@@ -200,7 +200,7 @@ @@ -200,7 +200,7 @@
200 <script> 200 <script>
201 201
202 const fecha = require('fecha'); 202 const fecha = require('fecha');
203 - import {addRoute,selectRoute} from '../../api/transport' 203 + import {addRoute} from '../../api/transport'
204 export default { 204 export default {
205 data(){ 205 data(){
206 return{ 206 return{
@@ -258,7 +258,7 @@ @@ -258,7 +258,7 @@
258 } 258 }
259 }, 259 },
260 methods:{ 260 methods:{
261 - //保存航线方法 261 + //新增航线方法
262 submitForm(formName) { 262 submitForm(formName) {
263 this.$refs[formName].validate((valid) => { 263 this.$refs[formName].validate((valid) => {
264 if (valid) { 264 if (valid) {
@@ -267,6 +267,8 @@ @@ -267,6 +267,8 @@
267 if(response.code=='200'){ 267 if(response.code=='200'){
268 this.centerDialogVisible=true; 268 this.centerDialogVisible=true;
269 this.msg=response.msg; 269 this.msg=response.msg;
  270 + this.$router.push({path:'/queryRoute',query:{serialNo:JSON.stringify(this.airline.serialNo)}});
  271 + this.centerDialogVisible=false;
270 }else{ 272 }else{
271 this.centerDialogVisible=true; 273 this.centerDialogVisible=true;
272 this.msg=response.msg; 274 this.msg=response.msg;
@@ -278,6 +280,7 @@ @@ -278,6 +280,7 @@
278 } 280 }
279 }); 281 });
280 }, 282 },
  283 + //分页方法
281 handleSizeChange(val) { 284 handleSizeChange(val) {
282 console.log(`每页 ${val} 条`); 285 console.log(`每页 ${val} 条`);
283 }, 286 },
@@ -291,7 +294,36 @@ @@ -291,7 +294,36 @@
291 this.airline.effStartdate=row.effStartdate; 294 this.airline.effStartdate=row.effStartdate;
292 this.airline.effEnddate=row.effEnddate; 295 this.airline.effEnddate=row.effEnddate;
293 this.dialogTableVisible=false; 296 this.dialogTableVisible=false;
  297 + },
  298 + //加载默认值
  299 + defaultData(){
  300 + if(this.$route.query!=null){
  301 + this.airline.uuid=JSON.parse(this.$route.query.uuid);
  302 + this.airline.serialNo=JSON.parse(this.$route.query.serialNo);
  303 + this.airline.departurePort=JSON.parse(this.$route.query.departurePort);
  304 + this.airline.arrivalPort=JSON.parse(this.$route.query.arrivalPort);
  305 + this.airline.departureCustomNo=JSON.parse(this.$route.query.departureCustomNo);
  306 + this.airline.arrivalCustomNo=JSON.parse(this.$route.query.arrivalCustomNo);
  307 + this.airline.cancelFlag=JSON.parse(this.$route.query.cancelFlag);
  308 + this.airline.meno=JSON.parse(this.$route.query.meno);
  309 + this.airline.planno=JSON.parse(this.$route.query.planno);
  310 + this.airline.std=fecha.parse(JSON.parse(this.$route.query.std),'HHmmss');
  311 + this.airline.sta=fecha.parse(JSON.parse(this.$route.query.sta),'HHmmss');
  312 + this.airline.effStartdate=JSON.parse(this.$route.query.effStartdate);
  313 + this.airline.effEnddate=JSON.parse(this.$route.query.effEnddate);
  314 + this.airline.plan=JSON.parse(this.$route.query.plan);
  315 + this.airline.remark=JSON.parse(this.$route.query.remark);
  316 + this.airline.createTime=JSON.parse(this.$route.query.createTime);
  317 + this.airline.createBy=JSON.parse(this.$route.query.createBy);
  318 + this.airline.updateTime=JSON.parse(this.$route.query.updateTime);
  319 + this.airline.updateBy=JSON.parse(this.$route.query.updateBy);
  320 + this.airline.isDelete=JSON.parse(this.$route.query.isDelete);
  321 + }
294 } 322 }
295 }, 323 },
  324 + //渲染方法
  325 + mounted(){
  326 + this.defaultData();
  327 + }
296 } 328 }
297 </script> 329 </script>