作者 小范

运输工具通用查询

@@ -80,6 +80,8 @@ @@ -80,6 +80,8 @@
80 <el-date-picker 80 <el-date-picker
81 v-model="aircraft.deliverDate" 81 v-model="aircraft.deliverDate"
82 type="date" 82 type="date"
  83 + value-format="yyyyMMdd"
  84 + format="yyyyMMdd"
83 style="width:100%" 85 style="width:100%"
84 placeholder="选择日期"> 86 placeholder="选择日期">
85 </el-date-picker> 87 </el-date-picker>
@@ -96,6 +98,20 @@ @@ -96,6 +98,20 @@
96 <el-col :span="24"> <el-button type="primary" @click="submitForm('aircraft')">保 存</el-button> 98 <el-col :span="24"> <el-button type="primary" @click="submitForm('aircraft')">保 存</el-button>
97 <el-button type="success">保存并发送</el-button></el-col> 99 <el-button type="success">保存并发送</el-button></el-col>
98 </el-row> 100 </el-row>
  101 + <!--对话提示框-->
  102 + <el-row>
  103 + <el-dialog
  104 + title="系统提示"
  105 + :visible.sync="centerDialogVisible"
  106 + width="30%"
  107 + center>
  108 + <span>{{msg}}</span>
  109 + <span slot="footer" class="dialog-footer">
  110 + <el-button @click="centerDialogVisible = false">取 消</el-button>
  111 + <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
  112 + </span>
  113 + </el-dialog>
  114 + </el-row>
99 </el-main> 115 </el-main>
100 </el-container> 116 </el-container>
101 </template> 117 </template>
@@ -118,6 +134,8 @@ @@ -118,6 +134,8 @@
118 .el-col{margin-right: 0px;} 134 .el-col{margin-right: 0px;}
119 </style> 135 </style>
120 <script> 136 <script>
  137 + const fecha = require('fecha');
  138 + import {addAircraft} from "../../api/transport";
121 export default { 139 export default {
122 data(){ 140 data(){
123 return{ 141 return{
@@ -190,9 +208,44 @@ @@ -190,9 +208,44 @@
190 deliverDate: [ 208 deliverDate: [
191 {required: true, message: '请输入', trigger: 'blur'} 209 {required: true, message: '请输入', trigger: 'blur'}
192 ], 210 ],
  211 + },
  212 + centerDialogVisible:false,
  213 + }
  214 + },
  215 + methods:{
  216 + //新增当日飞行计划(保存按钮)
  217 + submitForm(formName) {
  218 + this.$refs[formName].validate((valid) => {
  219 + if (valid) {
  220 + addAircraft(this.aircraft).then(res=>{
  221 + let response=res.data;
  222 + if(response.code=='200'){
  223 + this.centerDialogVisible=true;
  224 + this.msg=response.msg;
  225 + this.$router.push({path:'/queryAircraft',query:{airwayCode:JSON.stringify(this.aircraft.airwayCode)}});
  226 + }else{
  227 + this.msg=response.msg;
193 } 228 }
  229 + });
  230 + } else {
  231 + console.log('error submit!!');
  232 + return false;
194 } 233 }
  234 + });
195 }, 235 },
196 - methods(){} 236 + //加载默认值
  237 + defaultData(){
  238 + if(this.$route.query!=null){
  239 + let ob=Object.assign(this.aircraft, this.$route.query);
  240 + /*有时分秒时用fecha
  241 + this.flight.flightDate=ob.flightDate;
  242 + this.flight.currentLandingTime=fecha.parse(ob.currentLandingTime,'yyyyMMddHHmm');
  243 + this.flight.currentTakeoffTime=fecha.parse(ob.currentTakeoffTime,'yyyyMMddHHmm');*/
  244 + }
  245 + },
  246 + },
  247 + mounted(){
  248 + this.defaultData();
  249 + }
197 } 250 }
198 </script> 251 </script>
@@ -111,6 +111,7 @@ @@ -111,6 +111,7 @@
111 dischargecompleteddatetime:undefined, 111 dischargecompleteddatetime:undefined,
112 arrivaldatetime:undefined, 112 arrivaldatetime:undefined,
113 meno:undefined, 113 meno:undefined,
  114 + accessFlag:'0'
114 }, 115 },
115 rules: { 116 rules: {
116 aircraftNo: [ 117 aircraftNo: [
@@ -99,6 +99,7 @@ @@ -99,6 +99,7 @@
99 arrivaldatetime:undefined, 99 arrivaldatetime:undefined,
100 stayid:undefined, 100 stayid:undefined,
101 meno:undefined, 101 meno:undefined,
  102 + accessFlag:'0'
102 }, 103 },
103 rules: { 104 rules: {
104 aircraftNo: [ 105 aircraftNo: [
@@ -87,6 +87,7 @@ @@ -87,6 +87,7 @@
87 departuredatetime:undefined, 87 departuredatetime:undefined,
88 customDistrictNo:undefined, 88 customDistrictNo:undefined,
89 meno:undefined, 89 meno:undefined,
  90 + accessFlag:'1'
90 }, 91 },
91 rules: { 92 rules: {
92 aircraftNo: [ 93 aircraftNo: [
@@ -99,6 +99,7 @@ @@ -99,6 +99,7 @@
99 stayid:undefined, 99 stayid:undefined,
100 departuredatetime:undefined, 100 departuredatetime:undefined,
101 meno:undefined, 101 meno:undefined,
  102 + accessFlag:'1'
102 }, 103 },
103 rules: { 104 rules: {
104 aircraftNo: [ 105 aircraftNo: [
@@ -18,6 +18,8 @@ @@ -18,6 +18,8 @@
18 <el-date-picker 18 <el-date-picker
19 v-model="flight.flightDate" 19 v-model="flight.flightDate"
20 type="date" 20 type="date"
  21 + value-format="yyyyMMdd"
  22 + format="yyyyMMdd"
21 style="width:100%" 23 style="width:100%"
22 placeholder="选择日期"> 24 placeholder="选择日期">
23 </el-date-picker> 25 </el-date-picker>
@@ -52,8 +54,10 @@ @@ -52,8 +54,10 @@
52 <el-date-picker 54 <el-date-picker
53 v-model="flight.currentTakeoffTime" 55 v-model="flight.currentTakeoffTime"
54 type="date" 56 type="date"
  57 + format="yyyyMMddHHmm"
  58 + value-format="yyyyMMddHHmm"
55 style="width:100%" 59 style="width:100%"
56 - placeholder="选择日期"> 60 + placeholder="任意时间点">
57 </el-date-picker> 61 </el-date-picker>
58 </el-form-item> 62 </el-form-item>
59 </el-col> 63 </el-col>
@@ -62,8 +66,10 @@ @@ -62,8 +66,10 @@
62 <el-date-picker 66 <el-date-picker
63 v-model="flight.currentLandingTime" 67 v-model="flight.currentLandingTime"
64 type="date" 68 type="date"
  69 + format="yyyyMMddHHmm"
  70 + value-format="yyyyMMddHHmm"
65 style="width:100%" 71 style="width:100%"
66 - placeholder="选择日期"> 72 + placeholder="任意时间点">
67 </el-date-picker> 73 </el-date-picker>
68 </el-form-item> 74 </el-form-item>
69 </el-col> 75 </el-col>
@@ -100,6 +106,20 @@ @@ -100,6 +106,20 @@
100 </span> 106 </span>
101 </el-dialog> 107 </el-dialog>
102 </el-row> 108 </el-row>
  109 + <!--对话提示框-->
  110 + <el-row>
  111 + <el-dialog
  112 + title="系统提示"
  113 + :visible.sync="centerDialogVisible"
  114 + width="30%"
  115 + center>
  116 + <span>{{msg}}</span>
  117 + <span slot="footer" class="dialog-footer">
  118 + <el-button @click="centerDialogVisible = false">取 消</el-button>
  119 + <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
  120 + </span>
  121 + </el-dialog>
  122 + </el-row>
103 </el-main> 123 </el-main>
104 </el-container> 124 </el-container>
105 </template> 125 </template>
@@ -122,8 +142,8 @@ @@ -122,8 +142,8 @@
122 .el-col{margin-right: 0px;} 142 .el-col{margin-right: 0px;}
123 </style> 143 </style>
124 <script> 144 <script>
125 - import {addFlightPlan} from "../../api/transport";  
126 const fecha = require('fecha'); 145 const fecha = require('fecha');
  146 + import {addFlightPlan} from "../../api/transport";
127 export default { 147 export default {
128 data(){ 148 data(){
129 return{ 149 return{
@@ -174,10 +194,12 @@ @@ -174,10 +194,12 @@
174 {value:'1',label:'客运'}, 194 {value:'1',label:'客运'},
175 {value:'2',label:'货运'} 195 {value:'2',label:'货运'}
176 ], 196 ],
  197 + centerDialogVisible:false,
  198 + msg:undefined
177 } 199 }
178 }, 200 },
179 methods:{ 201 methods:{
180 - //新增航线方法(保存按钮) 202 + //新增当日飞行计划(保存按钮)
181 submitForm(formName) { 203 submitForm(formName) {
182 this.$refs[formName].validate((valid) => { 204 this.$refs[formName].validate((valid) => {
183 if (valid) { 205 if (valid) {
@@ -186,7 +208,7 @@ @@ -186,7 +208,7 @@
186 if(response.code=='200'){ 208 if(response.code=='200'){
187 this.centerDialogVisible=true; 209 this.centerDialogVisible=true;
188 this.msg=response.msg; 210 this.msg=response.msg;
189 - this.$router.push({path:'/queryFlightplan',query:{serialNo:JSON.stringify(this.flight.serialNo)}}); 211 + this.$router.push({path:'/queryFlightplan',query:{flightNo:JSON.stringify(this.flight.flightNo)}});
190 }else{ 212 }else{
191 this.msg=response.msg; 213 this.msg=response.msg;
192 } 214 }
@@ -197,11 +219,23 @@ @@ -197,11 +219,23 @@
197 } 219 }
198 }); 220 });
199 }, 221 },
  222 + //加载默认值
  223 + defaultData(){
  224 + if(this.$route.query!=null){
  225 + let ob=Object.assign(this.flight, this.$route.query);
  226 + /*有时分秒时用fecha
  227 + this.flight.flightDate=ob.flightDate;
  228 + this.flight.currentLandingTime=fecha.parse(ob.currentLandingTime,'yyyyMMddHHmm');
  229 + this.flight.currentTakeoffTime=fecha.parse(ob.currentTakeoffTime,'yyyyMMddHHmm');*/
  230 + }
  231 + },
200 }, 232 },
201 // 过滤中英文 233 // 过滤中英文
202 inputMe(e){ 234 inputMe(e){
203 return e.replace(/[^a-zA-Z]/g,'').toUpperCase(); 235 return e.replace(/[^a-zA-Z]/g,'').toUpperCase();
204 }, 236 },
  237 + mounted(){
  238 + this.defaultData();
  239 + }
205 } 240 }
206 -  
207 </script> 241 </script>
@@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
30 <el-table 30 <el-table
31 :data="tableData" 31 :data="tableData"
32 border 32 border
  33 + v-loading="tableloading"
33 style="width: 100%;margin-bottom: 10px"> 34 style="width: 100%;margin-bottom: 10px">
34 <el-table-column 35 <el-table-column
35 fixed="left" 36 fixed="left"
@@ -44,7 +45,7 @@ @@ -44,7 +45,7 @@
44 </el-table-column> 45 </el-table-column>
45 <el-table-column 46 <el-table-column
46 fixed 47 fixed
47 - prop=ownerCo" 48 + prop=airwayCode"
48 label="航空器所有人代码" 49 label="航空器所有人代码"
49 width="120"> 50 width="120">
50 </el-table-column> 51 </el-table-column>
@@ -74,7 +75,7 @@ @@ -74,7 +75,7 @@
74 </el-table-column> 75 </el-table-column>
75 <el-table-column 76 <el-table-column
76 fixed 77 fixed
77 - prop="owner" 78 + prop="ownerCo"
78 label="航空器所有人" 79 label="航空器所有人"
79 width="120"> 80 width="120">
80 </el-table-column> 81 </el-table-column>
@@ -128,10 +129,10 @@ @@ -128,10 +129,10 @@
128 @size-change="handleSizeChange" 129 @size-change="handleSizeChange"
129 @current-change="handleCurrentChange" 130 @current-change="handleCurrentChange"
130 :current-page="currentPage" 131 :current-page="currentPage"
131 - :page-sizes="[100, 200, 300, 400]"  
132 - :page-size="100" 132 + :page-sizes="[10, 20, 30, 40]"
  133 + :page-size="pageSize"
133 layout="total, sizes, prev, pager, next, jumper" 134 layout="total, sizes, prev, pager, next, jumper"
134 - :total="400"> 135 + :total="total">
135 </el-pagination> 136 </el-pagination>
136 </div> 137 </div>
137 </el-row> 138 </el-row>
@@ -157,27 +158,90 @@ @@ -157,27 +158,90 @@
157 158
158 </style> 159 </style>
159 <script> 160 <script>
  161 + import {selectAircraft, editAircraft} from "../../api/transport";
  162 +
160 export default { 163 export default {
161 data(){ 164 data(){
162 return{ 165 return{
163 queryAircraft:{ 166 queryAircraft:{
164 - flightNo:undefined, 167 + airwayCode:undefined,
165 aircraftNo:undefined, 168 aircraftNo:undefined,
166 - flightDate:undefined,  
167 - accessFlag:undefined,  
168 }, 169 },
169 rules:{}, 170 rules:{},
170 labelPosition:'left', 171 labelPosition:'left',
171 - currentPage: 4,  
172 - tableData:[] 172 + currentPage: 1,
  173 + pageSize:10,
  174 + total:0,
  175 + tableData:[],
  176 + tableloading:false
  177 +
173 } 178 }
174 }, 179 },
175 methods: { 180 methods: {
  181 + //分页
176 handleSizeChange(val) { 182 handleSizeChange(val) {
177 - console.log(`每页 ${val} 条`); 183 + this.pageSize=val;
178 }, 184 },
179 handleCurrentChange(val) { 185 handleCurrentChange(val) {
180 - console.log(`当前页: ${val}`); 186 + this.currentPage=val;
  187 + this.submitForm();
  188 + },
  189 + //获取通用航空器列表
  190 + submitForm() {
  191 + let params = {
  192 + currentPage: this.currentPage, pageSize: this.pageSize, airwayCode: this.queryAircraft.airwayCode,
  193 + aircraftNo: this.queryAircraft.aircraftNo
  194 + };
  195 + this.tableloading = true;
  196 + selectAircraft(params).then(res => {
  197 + let response = res.data.data;
  198 + this.tableData = response.list;
  199 + this.tableloading = false;
  200 + this.total = response.total;
  201 + });
  202 + },
  203 + //列表删除功能
  204 + handleDel(index, row) {
  205 + this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  206 + confirmButtonText: '确定',
  207 + cancelButtonText: '取消',
  208 + type: 'warning'
  209 + }).then(() => {
  210 + editAircraft(row).then(res => {
  211 + let response = res.data;
  212 + if (response.code == '200') {
  213 + this.$message({
  214 + type: 'info',
  215 + message: '删除成功'
  216 + });
  217 + this.submitForm();
  218 + } else {
  219 + this.$message({
  220 + type: 'info',
  221 + message: '删除失败'
  222 + });
  223 + }
  224 + });
  225 + }).catch(() => {
  226 + this.$message({
  227 + type: 'info',
  228 + message: '已取消删除'
  229 + });
  230 + });
  231 + },
  232 + //获取默认值
  233 + defaultData() {
  234 + this.airwayCode = JSON.parse(this.$route.query.airwayCode);
  235 + this.aircraftNo = JSON.parse(this.$route.query.aircraftNo);
  236 + },
  237 + //编辑通用航空器
  238 + handleEdit(index,row){
  239 + this.$router.push({path:'/aircraft',query: row})
  240 + },
  241 + //渲染方法
  242 + mounted(){
  243 + this.defaultData();
  244 + this.submitForm();
181 } 245 }
182 }, 246 },
183 } 247 }
@@ -31,7 +31,6 @@ @@ -31,7 +31,6 @@
31 :data="tableData" 31 :data="tableData"
32 border 32 border
33 v-loading="tableloading" 33 v-loading="tableloading"
34 -  
35 style="width: 100%;margin-bottom: 10px"> 34 style="width: 100%;margin-bottom: 10px">
36 <el-table-column 35 <el-table-column
37 fixed="left" 36 fixed="left"
@@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
26 <el-date-picker 26 <el-date-picker
27 v-model="queryFlightplan.flightDate" 27 v-model="queryFlightplan.flightDate"
28 type="date" 28 type="date"
  29 + format="yyyyMMdd"
29 style="width:190px" 30 style="width:190px"
30 placeholder="选择日期"> 31 placeholder="选择日期">
31 </el-date-picker> 32 </el-date-picker>
@@ -174,7 +175,7 @@ @@ -174,7 +175,7 @@
174 175
175 </style> 176 </style>
176 <script> 177 <script>
177 - import {selectFlightPlan, editFlightPlan, selectBill, editBill} from "../../api/transport"; 178 + import {selectFlightPlan, editFlightPlan} from "../../api/transport";
178 export default { 179 export default {
179 data(){ 180 data(){
180 return{ 181 return{
@@ -188,20 +189,28 @@ @@ -188,20 +189,28 @@
188 currentPage: 1, 189 currentPage: 1,
189 pageSize:10, 190 pageSize:10,
190 total:0, 191 total:0,
191 - tableData:[] 192 + tableData: [],
  193 + tableloading:false
  194 +
192 } 195 }
193 }, 196 },
194 methods: { 197 methods: {
195 - handleSizeChange(val){},  
196 - handleCurrentChange(val){},  
197 - //获取单据列表 198 + //分页
  199 + handleSizeChange(val) {
  200 + this.pageSize=val;
  201 + },
  202 + handleCurrentChange(val) {
  203 + this.currentPage=val;
  204 + this.submitForm();
  205 + },
  206 + //获取当日飞行计划列表
198 submitForm() { 207 submitForm() {
199 let params = { 208 let params = {
200 currentPage: this.currentPage, pageSize: this.pageSize, flightNo: this.queryFlightplan.flightNo, 209 currentPage: this.currentPage, pageSize: this.pageSize, flightNo: this.queryFlightplan.flightNo,
201 aircraftNo: this.queryFlightplan.aircraftNo, flightDate: this.queryFlightplan.flightDate 210 aircraftNo: this.queryFlightplan.aircraftNo, flightDate: this.queryFlightplan.flightDate
202 }; 211 };
203 this.tableloading = true; 212 this.tableloading = true;
204 - selectBill(params).then(res => { 213 + selectFlightPlan(params).then(res => {
205 let response = res.data.data; 214 let response = res.data.data;
206 this.tableData = response.list; 215 this.tableData = response.list;
207 this.tableloading = false; 216 this.tableloading = false;
@@ -238,33 +247,20 @@ @@ -238,33 +247,20 @@
238 }); 247 });
239 }, 248 },
240 //获取默认值 249 //获取默认值
241 - /*defaultData() { 250 + defaultData() {
242 this.flightNo = JSON.parse(this.$route.query.flightNo); 251 this.flightNo = JSON.parse(this.$route.query.flightNo);
243 - this.aircraftNo = JSON.parse(this.$route.query.aircraftNo);  
244 this.flightDate = JSON.parse(this.$route.query.flightDate); 252 this.flightDate = JSON.parse(this.$route.query.flightDate);
245 - },*/  
246 - //编辑单据查询  
247 - /*handleEdit(index,row){  
248 - this.$router.push({path:'/bill',query:  
249 - {  
250 - uuid:JSON.stringify(row.uuid),  
251 - flightNo:JSON.stringify(row.flightNo),  
252 - flightDate:JSON.stringify(row.flightDate),  
253 - departurePort:JSON.stringify(row.departurePort),  
254 - departureCustomNo:JSON.stringify(row.departureCustomNo),  
255 - arrivalPort:JSON.stringify(row.arrivalPort),  
256 - arrivalCustomNo:JSON.stringify(row.arrivalCustomNo),  
257 - currentTakeoffTime:JSON.stringify(row.currentTakeoffTime),  
258 - currentLandingTime:JSON.stringify(row.currentLandingTime),  
259 - linesType:JSON.stringify(row.linesType)},*/  
260 -  
261 - 253 + this.aircraftNo = JSON.parse(this.$route.query.aircraftNo);
  254 + },
  255 + //编辑当日飞行计划
  256 + handleEdit(index,row){
  257 + this.$router.push({path:'/flightplan',query: row})
262 }, 258 },
263 //渲染方法 259 //渲染方法
264 mounted(){ 260 mounted(){
265 - //this.defaultData(); 261 + this.defaultData();
266 this.submitForm(); 262 this.submitForm();
267 - },  
268 - 263 + }
  264 + }
269 } 265 }
270 </script> 266 </script>
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 </el-row> 8 </el-row>
9 <!-- 搜索区域--> 9 <!-- 搜索区域-->
10 <el-row> 10 <el-row>
11 - <el-form :label-position="labelPosition" :model="queryRouteaircraft" :rules="rules" ref="queryAircraft" 11 + <el-form :label-position="labelPosition" :model="queryRouteaircraft" :rules="rules" ref="queryRouteaircraft"
12 label-width="130px" class="demo-ruleForm"> 12 label-width="130px" class="demo-ruleForm">
13 <el-col :span="8"> 13 <el-col :span="8">
14 <el-form-item label="航空器所有人代码:" prop="airwayCode" label-width="130px"> 14 <el-form-item label="航空器所有人代码:" prop="airwayCode" label-width="130px">
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 </el-form-item> 21 </el-form-item>
22 </el-col> 22 </el-col>
23 <el-col :span="6" > 23 <el-col :span="6" >
24 - <el-button type="primary" @click="submitForm('queryBill')">查询</el-button> 24 + <el-button type="primary" @click="submitForm('queryRouteaircraft')">查询</el-button>
25 </el-col> 25 </el-col>
26 </el-form> 26 </el-form>
27 </el-row> 27 </el-row>
@@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
30 <el-table 30 <el-table
31 :data="tableData" 31 :data="tableData"
32 border 32 border
  33 + v-loading="tableloading"
33 style="width: 100%;margin-bottom: 10px"> 34 style="width: 100%;margin-bottom: 10px">
34 <el-table-column 35 <el-table-column
35 fixed="left" 36 fixed="left"
@@ -134,10 +135,10 @@ @@ -134,10 +135,10 @@
134 @size-change="handleSizeChange" 135 @size-change="handleSizeChange"
135 @current-change="handleCurrentChange" 136 @current-change="handleCurrentChange"
136 :current-page="currentPage" 137 :current-page="currentPage"
137 - :page-sizes="[100, 200, 300, 400]"  
138 - :page-size="100" 138 + :page-sizes="[10, 20, 30, 40]"
  139 + :page-size="pageSize"
139 layout="total, sizes, prev, pager, next, jumper" 140 layout="total, sizes, prev, pager, next, jumper"
140 - :total="400"> 141 + :total="total">
141 </el-pagination> 142 </el-pagination>
142 </div> 143 </div>
143 </el-row> 144 </el-row>
@@ -163,28 +164,90 @@ @@ -163,28 +164,90 @@
163 164
164 </style> 165 </style>
165 <script> 166 <script>
  167 + import {editAirLineAircraft, selectAirLineAircraft} from "../../api/transport";
  168 +
166 export default { 169 export default {
167 data(){ 170 data(){
168 return{ 171 return{
169 queryRouteaircraft:{ 172 queryRouteaircraft:{
170 - flightNo:undefined, 173 + airwayCode:undefined,
171 aircraftNo:undefined, 174 aircraftNo:undefined,
172 - flightDate:undefined,  
173 - accessFlag:undefined,  
174 }, 175 },
175 -  
176 labelPosition:'left', 176 labelPosition:'left',
177 - currentPage: 4,  
178 - tableData:[] 177 + currentPage: 1,
  178 + pageSize:10,
  179 + total:0,
  180 + tableData:[],
  181 + tableloading:false
179 } 182 }
180 }, 183 },
181 methods: { 184 methods: {
  185 + //分页
182 handleSizeChange(val) { 186 handleSizeChange(val) {
183 - console.log(`每页 ${val} 条`); 187 + this.pageSize=val;
184 }, 188 },
185 handleCurrentChange(val) { 189 handleCurrentChange(val) {
186 - console.log(`当前页: ${val}`); 190 + this.currentPage=val;
  191 + this.submitForm();
  192 + },
  193 + //获取航线航空器列表
  194 + submitForm() {
  195 + let params = {
  196 + currentPage: this.currentPage, pageSize: this.pageSize, airwayCode: this.queryRouteaircraft.airwayCode,
  197 + aircraftNo: this.queryRouteaircraft.aircraftNo
  198 + };
  199 + this.tableloading = true;
  200 + selectAirLineAircraft(params).then(res => {
  201 + let response = res.data.data;
  202 + this.tableData = response.list;
  203 + this.tableloading = false;
  204 + this.total = response.total;
  205 + });
  206 + },
  207 + //列表删除功能
  208 + handleDel(index, row) {
  209 + this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  210 + confirmButtonText: '确定',
  211 + cancelButtonText: '取消',
  212 + type: 'warning'
  213 + }).then(() => {
  214 + editAirLineAircraft(row).then(res => {
  215 + let response = res.data;
  216 + if (response.code == '200') {
  217 + this.$message({
  218 + type: 'info',
  219 + message: '删除成功'
  220 + });
  221 + this.submitForm();
  222 + } else {
  223 + this.$message({
  224 + type: 'info',
  225 + message: '删除失败'
  226 + });
187 } 227 }
  228 + });
  229 + }).catch(() => {
  230 + this.$message({
  231 + type: 'info',
  232 + message: '已取消删除'
  233 + });
  234 + });
  235 + },
  236 + //获取默认值
  237 + defaultData() {
  238 + this.airwayCode = JSON.parse(this.$route.query.airwayCode);
  239 + this.aircraftNo = JSON.parse(this.$route.query.aircraftNo);
188 }, 240 },
  241 + //编辑航线航空器
  242 + handleEdit(index,row){
  243 + this.$router.push({path:'/routeaircraft',query: row})
  244 + },
  245 + //渲染方法
  246 + mounted(){
  247 + this.defaultData();
  248 + this.submitForm();
  249 + }
  250 + }
  251 +
189 } 252 }
190 </script> 253 </script>
@@ -80,6 +80,8 @@ @@ -80,6 +80,8 @@
80 <el-date-picker 80 <el-date-picker
81 v-model="aircraft.deliverDate" 81 v-model="aircraft.deliverDate"
82 type="date" 82 type="date"
  83 + value-format="yyyyMMdd"
  84 + format="yyyyMMdd"
83 style="width:100%" 85 style="width:100%"
84 placeholder="选择日期"> 86 placeholder="选择日期">
85 </el-date-picker> 87 </el-date-picker>
@@ -96,6 +98,20 @@ @@ -96,6 +98,20 @@
96 <el-col :span="24"> <el-button type="primary" @click="submitForm('aircraft')">保 存</el-button> 98 <el-col :span="24"> <el-button type="primary" @click="submitForm('aircraft')">保 存</el-button>
97 <el-button type="success">保存并发送</el-button></el-col> 99 <el-button type="success">保存并发送</el-button></el-col>
98 </el-row> 100 </el-row>
  101 + <!--对话提示框-->
  102 + <el-row>
  103 + <el-dialog
  104 + title="系统提示"
  105 + :visible.sync="centerDialogVisible"
  106 + width="30%"
  107 + center>
  108 + <span>{{msg}}</span>
  109 + <span slot="footer" class="dialog-footer">
  110 + <el-button @click="centerDialogVisible = false">取 消</el-button>
  111 + <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
  112 + </span>
  113 + </el-dialog>
  114 + </el-row>
99 </el-main> 115 </el-main>
100 </el-container> 116 </el-container>
101 </template> 117 </template>
@@ -118,6 +134,8 @@ @@ -118,6 +134,8 @@
118 .el-col{margin-right: 0px;} 134 .el-col{margin-right: 0px;}
119 </style> 135 </style>
120 <script> 136 <script>
  137 + import {addFlightPlan} from "../../api/transport";
  138 +
121 export default { 139 export default {
122 data(){ 140 data(){
123 return{ 141 return{
@@ -191,9 +209,39 @@ @@ -191,9 +209,39 @@
191 {required: true, message: '请输入', trigger: 'blur'} 209 {required: true, message: '请输入', trigger: 'blur'}
192 ], 210 ],
193 }, 211 },
194 - 212 + centerDialogVisible:false,
195 } 213 }
196 }, 214 },
197 - methods(){} 215 + methods:{
  216 + //新增航线航空器(保存按钮)
  217 + submitForm(formName) {
  218 + this.$refs[formName].validate((valid) => {
  219 + if (valid) {
  220 + addFlightPlan(this.aircraft).then(res=>{
  221 + let response=res.data;
  222 + if(response.code=='200'){
  223 + this.centerDialogVisible=true;
  224 + this.msg=response.msg;
  225 + this.$router.push({path:'/queryRouteaircraft',query:{airwayCode:JSON.stringify(this.aircraft.airwayCode)},});
  226 + }else{
  227 + this.msg=response.msg;
  228 + }
  229 + });
  230 + } else {
  231 + console.log('error submit!!');
  232 + return false;
  233 + }
  234 + });
  235 + },
  236 + //加载默认值
  237 + defaultData(){
  238 + if(this.$route.query!=null){
  239 + let ob=Object.assign(this.airwayCode, this.$route.query);
  240 + }
  241 + },
  242 + },
  243 + mounted(){
  244 + this.defaultData();
  245 + }
198 } 246 }
199 </script> 247 </script>