Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
imac-vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Elements-SY
2023-10-17 09:46:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ac314ba3b98fc8ef588eeb913cf3a8e3c9fd17a9
ac314ba3
1 parent
16da5870
modify
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
2 deletions
src/views/systemConfig/dictionaryConfig/index.vue
src/views/systemConfig/dictionaryConfig/index.vue
View file @
ac314ba
...
...
@@ -88,7 +88,7 @@
</template>
</Tables>
<!-- 航线表 -->
<Tables v-
else-
if="tableName === '航线'" ductName="dictionary" :selection="true" :selectFixed="false"
<Tables v-if="tableName === '航线'" ductName="dictionary" :selection="true" :selectFixed="false"
:order='true' :height="tableHeight" :data="tableData" :headerData="routeTable" :page="selectDict.page"
:pageSizes="[20]" :totalCount="total" :loading="loading" @currentChange="currentChange"
layout="total,prev, pager, next, jumper, ->" @tableSelect="tableSelection"
...
...
@@ -100,6 +100,11 @@
}}<i class="el-icon-link"></i> </el-link>
</template>
<template slot="optionColumn">
<el-table-column label="是否为ET86航线" align="center">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.isEtesRoute" @change="checkboxIsEtesRoute(scope)"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" style="color:#ff4949" icon="el-icon-delete"
...
...
@@ -166,7 +171,7 @@
<script>
import Dialog from './dialog.vue'
import { getDictNameList, getDictionaryList, getServiceCodeList, delServiceCodeCihild, delDict, flightType, delFlight, queryRoute, delRoute, checkFlightRoute } from '@/api/system/dictionary.js'
import { getDictNameList, getDictionaryList, getServiceCodeList, delServiceCodeCihild, delDict, flightType, delFlight, queryRoute, delRoute, checkFlightRoute
, updateRoute
} from '@/api/system/dictionary.js'
export default {
name: 'DictionaryConfig',
...
...
@@ -225,6 +230,16 @@ export default {
mounted() {
this.tableHeight = window.innerHeight - this.$refs.dictForm.$el.offsetHeight - 270
},
filters: {
// 是否为ET86航线
isEtesRoute(val) {
if(val == "N"){
return "否"
}else{
return "是"
}
},
},
watch: {
tableName(val, oldVal) {
this.tableName = val
...
...
@@ -236,6 +251,25 @@ export default {
},
},
methods: {
/*
【更新航线】
更新路由成功后不用去调查询接口,
因为即便不去刷新页面调查询接口,
当前checkBox都是当前操作的状态;
所以调不调查询接口没有意义,反而消耗后台服务;
*/
async updateRouteSubmit(params){
await updateRoute(params).then(res=>{
if(res.code == 200){
this.msgSuccess(res.msg)
}else{
this.msgError(res.msg);
}
}).catch(err => {
console.log(err)
this.msgWarning(err)
})
},
//字典名称
dictNameSelect() {
getDictNameList().then(res => {
...
...
@@ -289,6 +323,13 @@ export default {
}
queryRoute(obj).then(res => {
if (res.code === 200) {
res.data.list.map(item=>{
if(item.isEtesRoute == "N" || item.isEtesRoute == null){
item.isEtesRoute = false;
}else{
item.isEtesRoute = true;
}
})
this.tableData = res.data.list
this.total = res.data.total
} else {
...
...
@@ -328,12 +369,28 @@ export default {
// },
//删除按钮
delDict(val) {
console.log(val)
if (this.tableName == 'serviceCode') {
this.serviceCodeCihildDel([val.id])
} else if (this.tableName === '虚拟航班') {
this.flightDel([val.id])
} else if (this.tableName === '航线') {
/*
如果该航线是普通航线直接删,如果是ET86航线,那么要查询该航线有没有设置维度,
如果没有直接删,如果已经设置了维度是否考虑将该航线下的维度删掉再进行操作;
*/
if(!val.isEtesRoute){ // 普通航线
this.routeDel({ data: [val], id: [val.id] })
}else{ // ET86航线
this.$confirm("该航线是ET86航线。是否要删除", "注意!", {
closeOnClickModal: false,
confirmButtonText: "确定删除",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.routeDel({ data: [val], id: [val.id] })
}).catch(() => { })
}
} else {
this.dicDel([val.id])
}
...
...
@@ -496,6 +553,41 @@ export default {
serviceCodeTableSelectAll(val) {
this.nowSelect = val
},
// 确认消息提示
confirmHandle($index, row){
this.$confirm(row.msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
let params = {
id: row.id,
fltNo: row.fltNo,
route: row.route,
isEtesRoute: row.isEtesRoute ? "Y" : "N"
}
this.updateRouteSubmit(params);
})
.catch(() => {
this.tableData[$index].isEtesRoute = !this.tableData[$index].isEtesRoute;
});
},
// checkBox是否设置ET86航线
checkboxIsEtesRoute({ $index, row }){
if(!row.isEtesRoute){
/*
将ET86设置成普通航线要查询校验该航线有没有设置维度,
如果该航线设置了ET86维度是否考虑将该航线下的维度删掉再进行操作;
*/
row.msg = "是否将该航线设置为非ET86航线?";
this.confirmHandle($index, row)
}else{
row.msg = "是否将该航线设置为ET86航线?";
this.confirmHandle($index, row)
}
}
}
}
</script>
...
...
Please
register
or
login
to post a comment