Elements-SY

modify

...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
88 </template> 88 </template>
89 </Tables> 89 </Tables>
90 <!-- 航线表 --> 90 <!-- 航线表 -->
91 - <Tables v-else-if="tableName === '航线'" ductName="dictionary" :selection="true" :selectFixed="false" 91 + <Tables v-if="tableName === '航线'" ductName="dictionary" :selection="true" :selectFixed="false"
92 :order='true' :height="tableHeight" :data="tableData" :headerData="routeTable" :page="selectDict.page" 92 :order='true' :height="tableHeight" :data="tableData" :headerData="routeTable" :page="selectDict.page"
93 :pageSizes="[20]" :totalCount="total" :loading="loading" @currentChange="currentChange" 93 :pageSizes="[20]" :totalCount="total" :loading="loading" @currentChange="currentChange"
94 layout="total,prev, pager, next, jumper, ->" @tableSelect="tableSelection" 94 layout="total,prev, pager, next, jumper, ->" @tableSelect="tableSelection"
...@@ -100,6 +100,11 @@ ...@@ -100,6 +100,11 @@
100 }}<i class="el-icon-link"></i> </el-link> 100 }}<i class="el-icon-link"></i> </el-link>
101 </template> 101 </template>
102 <template slot="optionColumn"> 102 <template slot="optionColumn">
103 + <el-table-column label="是否为ET86航线" align="center">
104 + <template slot-scope="scope">
105 + <el-checkbox v-model="scope.row.isEtesRoute" @change="checkboxIsEtesRoute(scope)"></el-checkbox>
106 + </template>
107 + </el-table-column>
103 <el-table-column label="操作" align="center"> 108 <el-table-column label="操作" align="center">
104 <template slot-scope="scope"> 109 <template slot-scope="scope">
105 <el-button size="mini" type="text" style="color:#ff4949" icon="el-icon-delete" 110 <el-button size="mini" type="text" style="color:#ff4949" icon="el-icon-delete"
...@@ -166,7 +171,7 @@ ...@@ -166,7 +171,7 @@
166 171
167 <script> 172 <script>
168 import Dialog from './dialog.vue' 173 import Dialog from './dialog.vue'
169 -import { getDictNameList, getDictionaryList, getServiceCodeList, delServiceCodeCihild, delDict, flightType, delFlight, queryRoute, delRoute, checkFlightRoute } from '@/api/system/dictionary.js' 174 +import { getDictNameList, getDictionaryList, getServiceCodeList, delServiceCodeCihild, delDict, flightType, delFlight, queryRoute, delRoute, checkFlightRoute, updateRoute } from '@/api/system/dictionary.js'
170 175
171 export default { 176 export default {
172 name: 'DictionaryConfig', 177 name: 'DictionaryConfig',
...@@ -225,6 +230,16 @@ export default { ...@@ -225,6 +230,16 @@ export default {
225 mounted() { 230 mounted() {
226 this.tableHeight = window.innerHeight - this.$refs.dictForm.$el.offsetHeight - 270 231 this.tableHeight = window.innerHeight - this.$refs.dictForm.$el.offsetHeight - 270
227 }, 232 },
233 + filters: {
234 + // 是否为ET86航线
235 + isEtesRoute(val) {
236 + if(val == "N"){
237 + return "否"
238 + }else{
239 + return "是"
240 + }
241 + },
242 + },
228 watch: { 243 watch: {
229 tableName(val, oldVal) { 244 tableName(val, oldVal) {
230 this.tableName = val 245 this.tableName = val
...@@ -236,6 +251,25 @@ export default { ...@@ -236,6 +251,25 @@ export default {
236 }, 251 },
237 }, 252 },
238 methods: { 253 methods: {
254 + /*
255 + 【更新航线】
256 + 更新路由成功后不用去调查询接口,
257 + 因为即便不去刷新页面调查询接口,
258 + 当前checkBox都是当前操作的状态;
259 + 所以调不调查询接口没有意义,反而消耗后台服务;
260 + */
261 + async updateRouteSubmit(params){
262 + await updateRoute(params).then(res=>{
263 + if(res.code == 200){
264 + this.msgSuccess(res.msg)
265 + }else{
266 + this.msgError(res.msg);
267 + }
268 + }).catch(err => {
269 + console.log(err)
270 + this.msgWarning(err)
271 + })
272 + },
239 //字典名称 273 //字典名称
240 dictNameSelect() { 274 dictNameSelect() {
241 getDictNameList().then(res => { 275 getDictNameList().then(res => {
...@@ -289,6 +323,13 @@ export default { ...@@ -289,6 +323,13 @@ export default {
289 } 323 }
290 queryRoute(obj).then(res => { 324 queryRoute(obj).then(res => {
291 if (res.code === 200) { 325 if (res.code === 200) {
326 + res.data.list.map(item=>{
327 + if(item.isEtesRoute == "N" || item.isEtesRoute == null){
328 + item.isEtesRoute = false;
329 + }else{
330 + item.isEtesRoute = true;
331 + }
332 + })
292 this.tableData = res.data.list 333 this.tableData = res.data.list
293 this.total = res.data.total 334 this.total = res.data.total
294 } else { 335 } else {
...@@ -328,12 +369,28 @@ export default { ...@@ -328,12 +369,28 @@ export default {
328 // }, 369 // },
329 //删除按钮 370 //删除按钮
330 delDict(val) { 371 delDict(val) {
372 + console.log(val)
331 if (this.tableName == 'serviceCode') { 373 if (this.tableName == 'serviceCode') {
332 this.serviceCodeCihildDel([val.id]) 374 this.serviceCodeCihildDel([val.id])
333 } else if (this.tableName === '虚拟航班') { 375 } else if (this.tableName === '虚拟航班') {
334 this.flightDel([val.id]) 376 this.flightDel([val.id])
335 } else if (this.tableName === '航线') { 377 } else if (this.tableName === '航线') {
336 - this.routeDel({ data: [val], id: [val.id] }) 378 + /*
379 + 如果该航线是普通航线直接删,如果是ET86航线,那么要查询该航线有没有设置维度,
380 + 如果没有直接删,如果已经设置了维度是否考虑将该航线下的维度删掉再进行操作;
381 + */
382 + if(!val.isEtesRoute){ // 普通航线
383 + this.routeDel({ data: [val], id: [val.id] })
384 + }else{ // ET86航线
385 + this.$confirm("该航线是ET86航线。是否要删除", "注意!", {
386 + closeOnClickModal: false,
387 + confirmButtonText: "确定删除",
388 + cancelButtonText: "取消",
389 + type: "warning",
390 + }).then(() => {
391 + this.routeDel({ data: [val], id: [val.id] })
392 + }).catch(() => { })
393 + }
337 } else { 394 } else {
338 this.dicDel([val.id]) 395 this.dicDel([val.id])
339 } 396 }
...@@ -496,6 +553,41 @@ export default { ...@@ -496,6 +553,41 @@ export default {
496 serviceCodeTableSelectAll(val) { 553 serviceCodeTableSelectAll(val) {
497 this.nowSelect = val 554 this.nowSelect = val
498 }, 555 },
556 + // 确认消息提示
557 + confirmHandle($index, row){
558 + this.$confirm(row.msg, "提示", {
559 + confirmButtonText: "确定",
560 + cancelButtonText: "取消",
561 + type: "warning",
562 + center: true,
563 + })
564 + .then(() => {
565 + let params = {
566 + id: row.id,
567 + fltNo: row.fltNo,
568 + route: row.route,
569 + isEtesRoute: row.isEtesRoute ? "Y" : "N"
570 + }
571 + this.updateRouteSubmit(params);
572 + })
573 + .catch(() => {
574 + this.tableData[$index].isEtesRoute = !this.tableData[$index].isEtesRoute;
575 + });
576 + },
577 + // checkBox是否设置ET86航线
578 + checkboxIsEtesRoute({ $index, row }){
579 + if(!row.isEtesRoute){
580 + /*
581 + 将ET86设置成普通航线要查询校验该航线有没有设置维度,
582 + 如果该航线设置了ET86维度是否考虑将该航线下的维度删掉再进行操作;
583 + */
584 + row.msg = "是否将该航线设置为非ET86航线?";
585 + this.confirmHandle($index, row)
586 + }else{
587 + row.msg = "是否将该航线设置为ET86航线?";
588 + this.confirmHandle($index, row)
589 + }
590 + }
499 } 591 }
500 } 592 }
501 </script> 593 </script>
......